Wouldn’t searching the array for each number in s be O(n^2). Forgive me I don’t know much big o in software engineering, but searching is O(n), right?
2024-05-22 18:52:35
25
40mikemike :
Let’s say you have the numbers [1, 100] this would search from [1, 100] followed by [2, 100] and then [3, 100] so on and so forth. So this is actually O(n^2) - lesson is complexity can sneak up on you
2024-05-22 19:10:53
10
gooo846 :
The different implementations only make a difference for bigger arrays. For up to 10 elements most runtime's Sets just use a list internally instead of hashing, because it's faster.
2024-06-02 16:54:08
0
Dima:) :
This is O(nlogn) complexity
2024-05-30 16:55:21
2
Bharatchadani :
Heap
2024-05-22 18:46:07
0
. :
I love how instead of explaining the code conceptually you just regurgitate it word by word
2024-05-26 16:25:52
45
sharkfacekilla :
Both solutions didn’t make any sense to me I’m cooked 🙃
2024-05-23 07:36:19
11
Greg Hogg :
Thank you for watching the video, drop a like if you enjoyed it! TikTok might be going away... follow me on IG (link in bio) to never miss a video :)
2024-05-22 18:23:24
0
sxzinit :
Work out with phone 💀
2024-05-22 18:36:25
0
x_summasmiff_x :
i didn’t know about sets! Thanks!!
2024-05-22 19:45:28
0
user699473 :
What, while num + 1 will not be true for inner loop, meaning it won’t go to [2.10
2024-05-23 02:37:19
0
Bruno Moreira :
where do you do this? its a site? aplication?
2024-05-23 19:38:33
0
DragonicOverlord15 :
is there an English explanation for this? it looks like that while loop in your for loop could potentially worst case an O(n^2). forgive me if I am wrong. could someone explain?
2024-05-31 22:45:16
0
Federico Grosso777 :
site name?
2024-06-06 09:10:35
0
mr blk :
does python know what i++ is for?
2024-06-27 07:57:54
0
shelabvwss :
😳😳😳
2024-08-13 20:29:27
0
To see more videos from user @greghogg5, please go to the Tikwm
homepage.