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...

Комментарии • 9

  • @AkashGupta-sh1pd
    @AkashGupta-sh1pd 4 месяца назад +2

    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

  • @RishinderRana
    @RishinderRana 4 месяца назад

    The best video for this problem so far

  • @debapriyachandra1767
    @debapriyachandra1767 6 месяцев назад

    We can optimise the count function! Using 2 pointers! You can look into the discussion section

  • @nandanimadhukar
    @nandanimadhukar Месяц назад

    very good explanation and technique

  • @prasadm3614
    @prasadm3614 6 месяцев назад

    Loved it !