Leetcode: 01 Two Sum [golang, 2021]

Опубликовано: 11 Июнь 2026
на канале: John McBride
7,226
180

► WATCH LIVE: https://twitch.com/johncodes
► Twitter:   / johncodezzz  
► Home page: https://johncodes.com
► Email me: [email protected]

This is the solution to Leetcode question 1: Two Sum using Golang.

#johncodes

🚀 SUMMARY:
Leetcode two sum can be solved trivially with a brute force using two iterations of the numbers array. The more elegant solution is to use a hashmap to store the complimentary number when iterating the slice.

🎵 MUSIC CREDITS:
► Outset island: Legend of Zelda - Wind Waker

🤔 About:
Hi all, I’m John, an experienced software engineer and open source software enthusiast / contributor. I make fun and informative videos about tech, engineering, productivity, and life! Like, comment, and subscribe for more!