SUBSCRIBED! Best explanation of this problem out there. I appreciate you explaining every little detail. Looking forward to more content, thanks bro! One minor enhancement would be to put a little more effort in the visual explanation, I know it sucks drawing out stuff but it helps us and it helps you (more watch time haha). Either way man, thanks!
I feel like I had that same question when I first did this problem but I don’t remember why. So the idea is we’re binary searching for the smallest value that results in a # of elements >= k. Whenever we test a candidate kth value, we check if the # of elements is >= k. If it is, record the candidate value and try a smaller candidate. If the smaller candidate also results in the # of elements being >= k, then record the new candidate. If the smaller candidate value results in the # of elements being < k, then we try a bigger candidate. Eventually we rule out all possibilities in the binary search, and the last value we recorded must be the smallest kth value that results in a # of elements >= k. At every iteration we’re honing in on the smallest kth value that satisfies our condition of having >= k elements. I would listen to the beginning again where I go over that example I came up with.
OMG! this is the only video where i understood the counting logic!!
Great explaination🔥 Understood everything....its great you are explaining every little things so there is no confusion.
Great job
How did you come up with the idea of choosing the bottom left or top right for calculating the no. of elements
SUBSCRIBED! Best explanation of this problem out there. I appreciate you explaining every little detail. Looking forward to more content, thanks bro!
One minor enhancement would be to put a little more effort in the visual explanation, I know it sucks drawing out stuff but it helps us and it helps you (more watch time haha). Either way man, thanks!
very great explanation KC **
best explanation out there
for candidate 13, less or equal count is 11 at 3:00min
great explanation
btw u kinda look like young might guy lool
@@douglascheng9794 As long as it’s 8 gates Might Guy lmao
Please zoom in while coding. It helps
I was thinking the same thing. I’ll zoom in for future vids.
Excellent!
Hi, Why could we guarantee that we can find the kth value in the matrix? I was confused about that since the start. Great explanation btw.
I feel like I had that same question when I first did this problem but I don’t remember why.
So the idea is we’re binary searching for the smallest value that results in a # of elements >= k.
Whenever we test a candidate kth value, we check if the # of elements is >= k. If it is, record the candidate value and try a smaller candidate.
If the smaller candidate also results in the # of elements being >= k, then record the new candidate.
If the smaller candidate value results in the # of elements being < k, then we try a bigger candidate. Eventually we rule out all possibilities in the binary search, and the last value we recorded must be the smallest kth value that results in a # of elements >= k.
At every iteration we’re honing in on the smallest kth value that satisfies our condition of having >= k elements.
I would listen to the beginning again where I go over that example I came up with.