Leetcode - Two sum solution explained in Javascript & Java | Coding interview question

  Рет қаралды 2,669

Shawn C

Shawn C

Күн бұрын

Пікірлер: 9
@viveknath6073
@viveknath6073 2 жыл бұрын
best explanation Broh❣️
@Heavenly_JesuschrisT
@Heavenly_JesuschrisT 2 жыл бұрын
Good explanation sir
@vladventura1928
@vladventura1928 3 жыл бұрын
Ah I was so close, I got an O(n) * 2 looking at the whole array twice and setting the difference as map key, and the current value as value; I like your solution much better!
@mscofield9925
@mscofield9925 3 жыл бұрын
Best explanation I have seen so far
@Courtney-yk2be
@Courtney-yk2be 2 жыл бұрын
Great explanation. Thank you for sharing!!
@jingkangloh7710
@jingkangloh7710 2 жыл бұрын
why is there a need for map.set(num[i], i); ? does it help with updating the 'diff' in the loop?
@geoffreylee1780
@geoffreylee1780 2 жыл бұрын
it need to store the pair of (key and indice) for future loop comparison
@nikithanikki3398
@nikithanikki3398 Жыл бұрын
you're explaining so well. would you please continue the series? 🥲it's very helpful ✨really like the way you explained the problem
@ShawnCTech
@ShawnCTech Жыл бұрын
Glad you like it
Two Sum | LeetCode 1 | JavaScript | Easy
13:20
Gordon Zhu
Рет қаралды 9 М.
Or is Harriet Quinn good? #cosplay#joker #Harriet Quinn
00:20
佐助与鸣人
Рет қаралды 53 МЛН
Leetcode Two Sum Solution |  Coding Interview Question
13:03
techsith
Рет қаралды 32 М.
Two Sum | Leetcode #1
16:21
Techdose
Рет қаралды 9 М.
15. 3Sum Leetcode Javascript Solution
17:27
JSDev
Рет қаралды 796
How To Solve Algorithms - Two Sum
6:56
Web Dev Simplified
Рет қаралды 81 М.
The unfair way I got good at Leetcode
6:47
Dave Burji
Рет қаралды 444 М.
TWO SUM - LeetCode 1 - Javascript Solution
4:43
Diana
Рет қаралды 27 М.
Premature Optimization
12:39
CodeAesthetic
Рет қаралды 805 М.
Beginner React.js Coding Interview (ft. Clément Mihailescu)
36:31
Ben Awad
Рет қаралды 2,1 МЛН
Or is Harriet Quinn good? #cosplay#joker #Harriet Quinn
00:20
佐助与鸣人
Рет қаралды 53 МЛН