Subsets 2 (LeetCode 90) | Full solution with backtracking examples | Interview | Study Algorithms

แชร์
ฝัง
  • เผยแพร่เมื่อ 22 ส.ค. 2024

ความคิดเห็น • 21

  • @l1z1ng3r
    @l1z1ng3r 2 หลายเดือนก่อน

    U ARE THE BEST EXPLAINER OF THE LEETCODE. Just keep it up bro🔥

    • @nikoo28
      @nikoo28  2 หลายเดือนก่อน +1

      trying my best

  • @rajeshpaithari7320
    @rajeshpaithari7320 4 หลายเดือนก่อน

    After watching Subsets and permutations, I was able to solve it on my own! Thanks

    • @nikoo28
      @nikoo28  4 หลายเดือนก่อน

      Excellent!

  • @AyushMishra-kq8sm
    @AyushMishra-kq8sm 10 หลายเดือนก่อน +3

    There is no need to use set.
    If you have already sorted the nums array simply add condition in for loop i.e
    if(i>idx && nums[i]==nums[i-1])
    continue;
    duplicates will be already removed

    • @pratikdey4239
      @pratikdey4239 7 หลายเดือนก่อน

      Where is he using the set?

    • @jackfrost8969
      @jackfrost8969 3 หลายเดือนก่อน

      @@pratikdey4239 to check for the duplicates

  • @sharaabsingh
    @sharaabsingh 7 หลายเดือนก่อน

    Hey @nikoo28, I am a regular viewer of your videos and honestly they are very helpful in understanding the concepts clearly. I have just a small suggestion for this explanation. Although, this approach works, but it is not optimal. Also, for someone like me who uses javascript, the includes method in js (equivalent to contains in java) will return false. Another approach can be to check inside the loop
    if(i > start && nums[i - 1] === nums[i]) continue;
    Not running the loop when this condition is there and this shall also give the same result.
    Nonetheless, please keep making these videos. You have no idea how much it makes our lives easier. Thank you for all the effort you put in. Cheers!

  • @manjunaik7792
    @manjunaik7792 5 หลายเดือนก่อน

    my respect towards your explanation sir

  • @satyamgupta6030
    @satyamgupta6030 ปีที่แล้ว

    thanks alot bhaiya I always look for ur videos even when I solve the problem my self as everytime I learn something from ur videos.

  • @BABATECHNOPEDIA
    @BABATECHNOPEDIA 6 หลายเดือนก่อน

    If you are putting result lists in set and checking if it contains the list than why you have sorted first no need to sort!!!

    • @nikoo28
      @nikoo28  5 หลายเดือนก่อน

      we want to remove all duplicates, hence sorting helps

  • @learnwithsadek7564
    @learnwithsadek7564 2 ปีที่แล้ว

    Brother, give me an order. Which playlist of your channel should I watch first and then what? Can you make some math videos? I am not very good at math but not that weak as well. Will you make it easy by teaching what exactly we need?

    • @nikoo28
      @nikoo28  2 ปีที่แล้ว

      The best way to start would be starting the Algorithmic Paradigms list
      Then move on to Data Structures.
      Start solving and look problems on LeetCode easy problems

    • @nikoo28
      @nikoo28  2 ปีที่แล้ว

      That will give you some direction on getting started.
      Reach out to me if you have more doubts.

  • @subee128
    @subee128 8 หลายเดือนก่อน

    Thank you

  • @vinamrasangal8436
    @vinamrasangal8436 7 หลายเดือนก่อน

    very bad explaination

    • @nikoo28
      @nikoo28  7 หลายเดือนก่อน +2

      which part did you struggle with?

    • @sonishukla356
      @sonishukla356 4 หลายเดือนก่อน

      ​@@nikoo28it was way better than others it helped me a lot
      .....just a question is it a full solution for back track approach and language u used it is Java??