Kth Smallest element in a matrix | Leetcode
HTML-код
- Опубликовано: 25 авг 2024
- 🟣 JOIN our 𝐋𝐈𝐕𝐄 𝐢𝐧𝐭𝐞𝐫𝐯𝐢𝐞𝐰 𝐭𝐫𝐚𝐢𝐧𝐢𝐧𝐠 𝐩𝐫𝐨𝐠𝐫𝐚𝐦 through whatsapp query: +91 8918633037
🟣 𝐂𝐡𝐞𝐜𝐤𝐨𝐮𝐭 𝐚𝐥𝐥 𝐨𝐮𝐫 𝐂𝐨𝐮𝐫𝐬𝐞𝐬: techdose.co.in/
This video explains how to find the kth smallest element in a matrix. We have discussed multiple techniques for solving this problem starting from bruteforce to heap and ending with the most optimal binary search technique.
----------------------------------------------------------------------------------------------------------------------------------------------------------------
🟢 𝐓𝐞𝐜𝐡𝐝𝐨𝐬𝐞-𝟏𝟎𝟎 𝐬𝐡𝐞𝐞𝐭: docs.google.co...
🟢 TELEGRAM channel ( 𝐏𝐃𝐅 𝐨𝐟 𝐯𝐢𝐝𝐞𝐨): t.me/codewithTECHDOSE
🔵 LinkedIn: / surya-pratap-kahar-47b...
🔴INSTAGRAM: / surya.pratap.k
---------------------------------------------------------------------------------------------------------------------------------------------------------------
Sliding Window Maximum: • Sliding Window Maximum...
𝐂𝐎𝐃𝐄 𝐋𝐈𝐍𝐊: gist.github.co...
A very important point to mention here is that mid element may or may not exists the the matrix
But since with keep high = mid (even for the case count_smaller == k), we sort of tend to converge to the lowest element in the matrix where count_smaller == k.
Hope this helps, if not I will post link to the solution where I have written print stmt to have full clarity
thanks..!!
The best video for this problem so far
Thanks
We can optimise the count function! Using 2 pointers! You can look into the discussion section
very good explanation and technique
Thanks
Loved it !
Thanks