Median of two sorted arrays, minimum number in rotated sorted array with duplicates, etc. Unbelievably convoluted mind fk algorithm.
Binary search is definitely hard. What’s hard about it is the off by one errors it produces
yeees off by one are so interesting
DP is the hardest
If you think binary search is the most challenging algorithm you’re in deep shit. Here I am trying to implement Shor’s algorithm, and that’s not even the hardest either.
Easy if you think about it correctly otherwise can be easy to mess up
Interesting, I find the binary search tk be one of the easiest. I struggle with a lot of the others though
Can you solve median of two sorted arrays?
Yes, I breezed through the binary seatxh neetcode section no hiccups. But I struggle a lot with other sections, I'm by no means a leetcode God. I just found that topic to be particularly intuitive. Interesting how different people have different intuitions, I actually made a post saying the exact opposite of what you did haha and people were agreeing
I hate edge cases 🤢 like is mid l+1 or what? L<r or l<=r 🤮
I never got stuck in those edge cases After getting rejected by one of my dream company I derived a template which fits for all binary search questions. Took me a week but not binary search is my strong point And this technique is not on striver or any other youtube channel teaching binary search
You wanna memorize those for the most part. And both l < r and l <= r work, stick with one
New grad?
Try binary search for a sliding window 🥲
Binary Search is easy. dijkstra's is tougher.
Dp I think is the hardest Throw me a new dp problem And I will run away
Yup a new dp problem in interview is like interviewer DPing me xD