Great video one suggestion for the channel. You should do 3 or 2 separate playlists on prefix sum, sliding window and backtracking. Those 3 along with modified binary search are some of the hardest questions. The former two(prefix sum and sliding window have significant overlap) But for a lot of people this is what they're looking for. Thank you and looking forward to more videos.
@sarayarmohammadi3376 Жыл бұрын
Thank you!
@YT.Nikolay2 жыл бұрын
One day, I am gonna hit the like button first. Thank you! Despite the fact it's quite a simple problem, I understand you can't solve medium+ every time. I encourage you to continue, you're doing a huge impact!
@subee128 Жыл бұрын
Thank you so much
@varunshrivastava27062 жыл бұрын
Very nice and decent solution, Keep up the good work mate. I do have one questions in my solution instead of finding max_seen, I created an array level and stored every level in that array and then appended the max for every level to my answer. What should be the space complexity in such scenario?
@crackfaang2 жыл бұрын
You ideally don’t want to do that because it’s an extra pass through each levels values and you are creating an array that doesn’t need to be created. Your interviewer will 100% ask you to improve on this. I think the space complexity in that situation is still O(N) in the end but it’s not ideal to do that solution
@varunshrivastava27062 жыл бұрын
@@crackfaang Can you tell me why would it remain the same O(N)?Will it also have any significant affect on the Time complexity as well? If let's suppose number of levels increases to 6 or 8.