tgis wont work, if you pushed into stack some light asteroids and then a heavy one on top
2024-03-16 18:36:57
0
Uto Csal :
this solution doesnt work, imagine the worst case, you could only eat initially the very last item, so now everything else is in the stack, you cant eat the top of the stack, but you could eat others
2024-03-19 16:08:30
2
Nick Ambrose :
Basically the days until higher temperature question
2024-03-11 19:55:34
0
Rae :
This might be the coolest interview question I’ve seen
2024-03-13 18:01:29
0
Sam :
When google becomes a space company then I will answer.
2024-03-14 16:41:55
0
Luis Emilio Juarez J :
Can’t we use a heap and pop until necessary?
2024-03-12 00:04:41
0
Paul Palezzi :
you crash through the stack several times, n times if anti sorted O(n²), 1 if sorted, maybe log(n) avg?!
2024-03-16 15:09:34
0
Greg Hogg :
Edit: the o(n) solution shouldn't work, but it passes the test cases anyway! Sorry about that!
2024-03-11 17:07:29
33
罗曼 :
heap?
2024-03-11 18:06:10
7
Varun Parekh :
would the time ne O(^2)? with the nested while loop
2024-03-11 13:53:11
6
Stepan Filonov :
Yapper😳
2024-05-21 22:09:53
0
Ken Adams :
Greedy problems, should sort the asteroid list like the first approach 😁
2024-05-22 04:01:01
0
mariuscomiati :
It is cool, but it is also wrong
2025-02-19 12:41:38
0
Bennie van Eeden :
Sorry. But I don't get it... What if you need something deeper down in the stack to overcome the mass?
2024-06-06 10:51:22
0
To see more videos from user @greghogg5, please go to the Tikwm
homepage.