Divide Nodes Into the Maximum Number of Groups | Leetcode 2493

Поделиться
HTML-код
  • Опубликовано: 8 фев 2025
  • This video explains Divide Nodes Into the Maximum Number of Groups problem using the most optimal bipartite graph solution using BFS.
    ----------------------------------------------------------------------------------------------------------------------------------------------------------------
    🟣 JOIN our 𝐋𝐈𝐕𝐄 𝐢𝐧𝐭𝐞𝐫𝐯𝐢𝐞𝐰 𝐭𝐫𝐚𝐢𝐧𝐢𝐧𝐠 𝐩𝐫𝐨𝐠𝐫𝐚𝐦 through whatsapp query: +91 8918633037
    🟣 𝐂𝐡𝐞𝐜𝐤𝐨𝐮𝐭 𝐚𝐥𝐥 𝐨𝐮𝐫 𝐂𝐨𝐮𝐫𝐬𝐞𝐬: techdose.co.in/
    🔵 LinkedIn: / surya-pratap-kahar
    🔴 INSTAGRAM: / techdose_official
    🟢 𝐓𝐞𝐜𝐡𝐝𝐨𝐬𝐞-𝟏𝟎𝟎 𝐬𝐡𝐞𝐞𝐭: docs.google.co...
    ---------------------------------------------------------------------------------------------------------------------------------------------------------------
    Possible Bipartition: • Possible Bipartition |...
    𝐂𝐎𝐃𝐄 𝐋𝐈𝐍𝐊: gist.github.co...

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

  • @kaushikelangovan3109
    @kaushikelangovan3109 10 дней назад +3

    I initially went through Neetcode's solution, I thought I understood everything he was explaining, but end of the video, I was stuck not knowing where to begin. Now after going through your video solution, you make it easy to understand what to exactly do for a problem step by step and I am even confident enough to even teach someone else how to solve this problem. Just brilliant, how you break down a complex problem into smaller sub-problem and explain it in detail. Thank you for this!

    • @techdose4u
      @techdose4u  9 дней назад +1

      welcome :)
      Putting some effort before actually explaining

  • @Anikait-h3d
    @Anikait-h3d 9 дней назад +2

    coming up with such logic is genius. By just seeing HARD written beside the question i feel like quitting

  • @freecourseplatformenglish2829
    @freecourseplatformenglish2829 8 дней назад

    Thanks man, as always I am out of words to appreciate how well you explained everything.

  • @fellowviber7792
    @fellowviber7792 9 дней назад

    i always appreciate when you mention similar problems and give overview about prerequisites

    • @techdose4u
      @techdose4u  9 дней назад

      I'm glad you find that helpful!

  • @BhagyaRana
    @BhagyaRana 9 дней назад

    Crystal Clear 🔥 Explaination! 👌🏻 Thank you TechDose for Superb Explaination 🔥👏🏻👏🏻! Quality of Content++!

    • @techdose4u
      @techdose4u  9 дней назад

      Thanks for the appreciation 🙏🏼

  • @Abhishek-e6d2c
    @Abhishek-e6d2c 9 дней назад +1

    How can someone be so good at explaining!!

    • @techdose4u
      @techdose4u  9 дней назад

      by god’s grace 🙏🏼
      Thanks for your appreciation

  • @levimatheri7682
    @levimatheri7682 7 дней назад

    I tried to read the editorial on leetcode and didn't quite get it. Then came here and now it all makes sense! Great job TechDose

  • @sriyashmishra5257
    @sriyashmishra5257 9 дней назад

    Superb explaination ❤

  • @maheshgnayak5721
    @maheshgnayak5721 9 дней назад

    Great video! Thank you!

  • @hariharan-kn1km
    @hariharan-kn1km 5 дней назад

    Thank You Sir

  • @sailendrachettri8521
    @sailendrachettri8521 10 дней назад

    Thank you sir :)

  • @johndurai2226
    @johndurai2226 10 дней назад

    brilliant sir

  • @shivnathkahar8985
    @shivnathkahar8985 10 дней назад

    Nice

  • @farhanahmad1731
    @farhanahmad1731 6 дней назад

    Why finding diameter of each component will not work here ?

    • @farhanahmad1731
      @farhanahmad1731 6 дней назад

      my bad, the graph can be cyclic here. So we can't directly find the diameter as we do for acyclic graph

    • @techdose4u
      @techdose4u  6 дней назад

      Its not a tree but graph :)

  • @divyasingh6771
    @divyasingh6771 10 дней назад +1

    java code is not there in code file

    • @fellowviber7792
      @fellowviber7792 9 дней назад

      use chatgpt to translate it , it's easy to get c++ to java translated

    • @techdose4u
      @techdose4u  9 дней назад

      Thanks for reminder.
      Updated Java & Python codes

  • @kartikrastogi1069
    @kartikrastogi1069 9 дней назад

    sir it is giving TLE

    • @techdose4u
      @techdose4u  9 дней назад

      it’s working fine.
      maybe you have missed dfs visited maker somehow.
      you need to revisit and match line by line

  • @sumitkumar-bb7kv
    @sumitkumar-bb7kv 10 дней назад

    thanks sir , we can calculate diameter in step 3 of algo which reqires only 2 bfs passes ,

    • @techdose4u
      @techdose4u  10 дней назад

      yes
      but finding diameter and using bfs may not always be correct.

  • @AkshSV-2030
    @AkshSV-2030 9 дней назад

    n = 16
    [[16,8],[6,5]]
    Expected: 16
    could you explain how??? 16

    • @techdose4u
      @techdose4u  9 дней назад

      bacause there are 16 nodes.
      Each node not having edge forms separate separate groups.
      Here 12 nodes are alone so 12 groups for that.
      Next you have 4 groups for nodes mentioned in edgelist.

    • @fellowviber7792
      @fellowviber7792 9 дней назад

      The graph has two disconnected parts
      >One part connects nodes 16 and 8
      >The other part connects nodes 6 and 5
      Since, these parts are separate and have no connections to each other, we can assign each node to its own group without breaking the rule that connected nodes must be in adjacent groups. because there are no extra constraints every node can be in a unique group
      This means the maximum number of groups is 16 which is total number of nodes.