This video definitely needs a shoutout. I was looking for the exact solution for this kind of problem. Thanks to Mike and the youtube algorithm for suggesting this gem.
@sameer93683 жыл бұрын
I am from India...you explain algorithm like a piece of cake..you definitely deserves a beer . May God bless you
@AlgosWithMichael3 жыл бұрын
So nice of you, thanks for the kind words!
@xueli56413 жыл бұрын
When I search on youtube for a Leetcode question, I know I will definitely understand how to solve it when your video is in the result list. Thanks, Michael!
@AlgosWithMichael3 жыл бұрын
Glad to hear that haha. No problem, anytime!
@wishimaunicorn Жыл бұрын
I swear no one, i mean NO ONE on the internet could have explain this question better than you. Please do more of these!!!
@noextrasugar4 ай бұрын
Wow!!! Are you my new fav LeetCode teacher?! Subscribed and saveddddd
@ubcomewhatublv2 жыл бұрын
7:49 Not sure if I understand this part correctly. I thought according to your binary search logic, since the mid point corresponding timestamp is 5. We should set left = mid instead of right = mid - 1. In that case, left = 1 and right = 1 which led to while loop condition ends (l < r). But this is just a small bug, this video is very informative. Thanks for your efforts!
@jiecheng.x13062 жыл бұрын
I agree with that. The while loop will stop when left = right = 1
@hnkien3 жыл бұрын
Awesome as usual. Thank you very much Michael.
@AlgosWithMichael3 жыл бұрын
My pleasure!
@indola33093 жыл бұрын
I was looking for this question yesterday and so needed you to explain it.. thank you so very much..you are the best!!!
@AlgosWithMichael3 жыл бұрын
Happy to help!
@nitanandsingh2 жыл бұрын
Well Explained. Will wait for more similar videos.
@vedantshinde22773 жыл бұрын
How did I not think about applying a binary search?! This is why it doesn't hurt to compare solutions!!
@AlgosWithMichael3 жыл бұрын
Haha very true!
@IChowdhury013 жыл бұрын
Could you do a video on what strategies you use to get interviews while on a job hunt? Stuff like cold emailing, cover letters, reaching out to recruiters on LinkedIn, networking (and how you do it), etc. Would be nice to know what works for you. Thanks. Love your Leetcode videos btw, the graphics help a lot.
@codestorywithMIK3 жыл бұрын
I recently got 3 offers. All 3 I got from LinkedIn contacts
@IChowdhury013 жыл бұрын
@@codestorywithMIK Did they reach out to you or you hit them up on LinkedIn?
@YashTrivedi213 жыл бұрын
Thanks for the awesome video, I have subscribed you from long time and I can see that your explanations are very crystal clear, thanks for that. Also can you attach question link in each of your video as you explain them? Just a suggestion
@indola33093 жыл бұрын
Leetcode 981
@YashTrivedi213 жыл бұрын
@@indola3309 thanks!
@AlgosWithMichael3 жыл бұрын
Good feedback, I will supply the problem in the description from now on
@YashTrivedi213 жыл бұрын
@@AlgosWithMichael appreciated!
@amaansiddiqui99854 ай бұрын
Thank you very much cat 🐈⬛. Much Appreciated.
@TiffanyNg1003 жыл бұрын
best explain, slow and but surely
@anuragtiwari30323 жыл бұрын
Such a smart cat ❤️❤️
@keepitsimplereal78592 жыл бұрын
Hey Michael, would you mind explaining while(l < r ) condition in binary search as you explained when l becomes equal to r, we stop binary seach and also what's the reason behind l = mid assignment after we discover data.get(mid).timestamp
@creativecubs35882 жыл бұрын
Nice explanation. Which software you are using for animations?
@LeHoangTu3 жыл бұрын
Well done! Thank you.
@johnchoe7625 Жыл бұрын
In the binary search, where does the + 1 come from in the "mid = (l + r + 1) / 2" ? I'm only used to doing (l + r) / 2
@worldwide6626 Жыл бұрын
Nice video
@CreativeMining413 Жыл бұрын
How do the lists become sorted so you can use binary search? I don't see them being sorted anywhere after we set a new value + timestamp.
@ameynaik27433 жыл бұрын
Do you have a video on all the variations of a binary search tree?
@bobma15502 жыл бұрын
can you please explain line 25 ? i thought if (data.get(mid).timestamp == timestamp, then we find the answer, and can return data.get(mid).key ?
@louischou67803 жыл бұрын
why do we need to create a "Data" class? Can we just use another map and store it in the list?
@sadokchebil43913 жыл бұрын
haha I like the cat
@AlgosWithMichael3 жыл бұрын
Hahah thank you :)
@bluesteel1 Жыл бұрын
Just store the midpoint whenver there's a match and keep going backwards
@Anubis101103 жыл бұрын
Why get(A,4) is B Not C ??
@xueli56413 жыл бұрын
At timestamp 4, A was not set to C yet. C was only set at timestamp 5.