@greghogg5: This is the Most Asked FAANG Interview Question! - Two Sum - Leetcode 1

Greg Hogg
Greg Hogg
Open In TikTok:
Region: CA
Saturday 23 March 2024 15:28:12 GMT
12357
366
8
12

Music

Download

Comments

joe892677
Joe :
The first for loop is not required. Just place the num and index in the map after the if statement
2024-04-17 19:40:59
2
gatenerd
GateNerd :
you could save a bit of time by removing each number from the hashmap after you check it since it’s matches are already found
2024-03-23 15:45:18
8
williamwallace16440
William Wallace1648 :
Isn’t “desired in h” an O(n) worst case so the total complexity is still O(n^2)?
2024-04-12 07:53:33
2
leorafaelmartinez
Leo Rafael Martinez :
Could you save time by only evaluating numbers that are < target? For example, why check 15 against anything, its already larger than 9
2025-09-25 11:37:54
0
greghogg5
Greg Hogg :
Why is FAANG obsessed with Two Sum?
2024-03-23 15:29:13
1
To see more videos from user @greghogg5, please go to the Tikwm homepage.

Other Videos


About