Subsets (Leetcode 78) - Medium (Hindi) | Backtracking + Iterative solution

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

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

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

    ✅ Useful Links
    𝐈𝐧𝐬𝐭𝐚𝐠𝐫𝐚𝐦 - instagram.com/codingwithprakash/
    𝐖𝐡𝐚𝐭𝐬𝐀𝐩𝐩𝐂𝐡𝐚𝐧𝐧𝐞𝐥 - whatsapp.com/channel/0029VaACtTa4tRrpDCQc5f44
    𝐋𝐢𝐧𝐤𝐞𝐝𝐢𝐧 - www.linkedin.com/in/prakash-shukla/

  • @vivekishore
    @vivekishore 2 ปีที่แล้ว +7

    I've been coding in CPP, And it's the first time I came across your video since I wasn't being able to get the approach or concept nicely from the other videos I watched, And after watching this video for an hour, my all doubts got cleared and it took me just 2 minutes to write this code in CPP. Thanks for explaining every concepts so nicely. And the way you've visualised us everything was really too good.❤️

  • @shobhitsharma1194
    @shobhitsharma1194 3 ปีที่แล้ว +10

    I have watched many videos but never felt like commenting. Today, I cannot stop myself. You have made this concept so easy that anyone can understand. keep helping us :)

  • @chandandigumarthy9652
    @chandandigumarthy9652 2 ปีที่แล้ว +9

    Man .. I don't know how and why I missed this all these days. This cleared many things for me

  • @105AvniUplabdhee-um1ud
    @105AvniUplabdhee-um1ud ปีที่แล้ว +3

    bro pls complete your other playlists like u did for backtracking, u r a really gr8 teacher

  • @ajit287
    @ajit287 3 ปีที่แล้ว +9

    Nice explanation. Plz bring this kind of challenging leetcode ques. Request to all viewers support him by watching ads without skipping it.

  • @sanjana8267
    @sanjana8267 2 ปีที่แล้ว +3

    I loved the explanation sir!
    Thank you soo so much!

  • @rupdeepthey
    @rupdeepthey ปีที่แล้ว +1

    Awesome. Best backtracking playlist in India.

  • @larsendsouza5898
    @larsendsouza5898 2 ปีที่แล้ว +4

    awesome explanation, your visualisation graphics helped me a lot to understand the removing element part very clearly, it was not explained in detail in any other videos...Thank you so much bro :)
    Appreciate your efforts to make such videos :)

  • @shameemahamad2617
    @shameemahamad2617 ปีที่แล้ว +2

    Best tutorial for recursion and subset.

  • @requisits
    @requisits ปีที่แล้ว +4

    Quality Content , you are a great teacher.

  • @AvidWanderlust
    @AvidWanderlust 2 ปีที่แล้ว +3

    Nice explanation, touching upon all the essential points

  • @pragyasingh5880
    @pragyasingh5880 3 ปีที่แล้ว +4

    best and the most simple explanation so far!

  • @tahaali01
    @tahaali01 2 ปีที่แล้ว +2

    Wow !! This question seemed so difficult to intuite, and now it looks like a piece if cake

  • @nidhiverma387
    @nidhiverma387 2 ปีที่แล้ว +1

    Best video ever on subsets. I understand backtracking of subset very easily

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

    Nice explanation 👍👍

  • @AbhishekSingh-vl1dp
    @AbhishekSingh-vl1dp ปีที่แล้ว

    woww,, what a great way of teaching ,, majja hi aa gaya samj ke thank you bahiyaa!!

  • @stith_pragya
    @stith_pragya ปีที่แล้ว +1

    Thank a ton Brother...........We need teachers like you.........🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻

  • @RajeshKumar._.16
    @RajeshKumar._.16 ปีที่แล้ว

    Very Nice Explanation, With the help of animation it was lot more easy to understand .

  • @rekhakalasare4910
    @rekhakalasare4910 2 ปีที่แล้ว +1

    Clear explanation! My question is for recursion case, once we clear the temp list at that point array is on last index. So how this function will create next branch?
    Also, when we shud add or multiply space and time complexity

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

    excellent videos. Never found such a good playlist. appreciate your help

  • @sannidiashish2312
    @sannidiashish2312 2 ปีที่แล้ว +1

    big brother lot of thanks......
    cleared many doubts ❤

  • @mohitkumar557
    @mohitkumar557 2 ปีที่แล้ว +1

    are sir maja hi aa gaya
    explanation sun ke hi code ho gaya
    now I am able to visualize little bit more

  • @sachindubey1590
    @sachindubey1590 ปีที่แล้ว +2

    Solved my all doubts 👌

  • @babushaikh6582
    @babushaikh6582 2 ปีที่แล้ว +1

    Nice explanation ... Easy to understand
    Thanks

  • @jitintaneja9512
    @jitintaneja9512 2 ปีที่แล้ว +1

    Nicely Explained Prakash. Great Job 👍

  • @raushanraj227
    @raushanraj227 ปีที่แล้ว +1

    Thanks bhaiya for amazing content

  • @ramanandkumar7780
    @ramanandkumar7780 2 ปีที่แล้ว +1

    Explanation is wonderful...

  • @sakshishinde9337
    @sakshishinde9337 ปีที่แล้ว +1

    very nice explanation sir

  • @theuntoldtree
    @theuntoldtree 2 ปีที่แล้ว +1

    helpful, quality,quantity,thank you.

  • @siddharthupadhyay4246
    @siddharthupadhyay4246 2 ปีที่แล้ว +1

    Amazing solution.

  • @HimanshuSingh-wd3bn
    @HimanshuSingh-wd3bn 2 ปีที่แล้ว +1

    Thanku sir.. To make esy concept
    Please make video how to approach pattern type qus.. That's means 1qus approch slove many many possible qus

  • @prashantagrawal1140
    @prashantagrawal1140 2 ปีที่แล้ว +1

    Great Shukla Ji

  • @shalabhbhatiya5659
    @shalabhbhatiya5659 3 ปีที่แล้ว +1

    Salute bro
    Nice explanation 👏👏👏

  • @abhineetsingh6720
    @abhineetsingh6720 2 ปีที่แล้ว +1

    badhiya bhai, nice explanation

  • @tanmaysatsangi131
    @tanmaysatsangi131 2 ปีที่แล้ว +2

    Hello Prakash, If we ignore the output space i.e. 'res' ArrayList then the space complexity is O(N){because of 'temp' ArrayList.
    Right ?
    Plz reply.

  • @kumarvivek02
    @kumarvivek02 3 ปีที่แล้ว +1

    why does res.Add() need to happen outside the for loop? I was trying this out myself after watching your video and I get the same result if I move it inside (which came naturally to me). Something like this (C# code snippet)
    for (int i = start; i < nums.Length; i++)
    {
    curr.Add(nums[i]);
    res.Add(curr.ToList());
    SetsHelper(i + 1, nums, res, curr);
    curr.RemoveAt(curr.Count() - 1);
    }

  • @jitintaneja9512
    @jitintaneja9512 2 ปีที่แล้ว +1

    Prakash have you covered permutation problem in your series?. I don't see any video of yours where you covered permutation I and II Problem. Please share the link for the same if you have.

  • @shellachaurasia5289
    @shellachaurasia5289 2 ปีที่แล้ว +1

    Bahut achcha bataya aapane

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

    Finest explanation..

  • @ImranKhan-ne3cj
    @ImranKhan-ne3cj ปีที่แล้ว

    GREAT!

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

    If both approach has same time complexity (n*2^n) then why recursive approach shows more time on leetcode🤔

  • @sulemanbaloch6565
    @sulemanbaloch6565 ปีที่แล้ว +1

    Only question I have is why doesnt the recursive algorithm add repeated sets. I know we cannot add repeated sets but where does it apply in the code ? like what line

    • @khateebanwer7466
      @khateebanwer7466 ปีที่แล้ว +1

      It's given in the question that every element is unique and at each step of subset generation for each num , we are moving to the right and element before the current index is not of concern so there isn't any chance of duplicacy
      Example : Suppose we have an array [1 ,2 , 3, 5, 4 ] then
      1) for 1 , we will be moving towards next elements 2 , 3 and so on
      2) for 5, we will be moving towards 4 and end
      3) so concerning 1 , we have formed subsets containing 1 during nums[0] branch creation (working of branch creation is explained in the video )
      4) now we will move to the next index and create subsets for nums[1] i.e 2 and elements occuring after it in same manner i.e [2] , [2,3] and so on.
      5) we can see that we are not concerning with any subset that contains 1 in nums[1] branch creation phase so there is not any chance of subsets existing like [2,1] and [3,1] as we won't be encountering 1 again as we move towards right (unique elements)

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

      I’m getting the repetitive elements and list in the result set

  • @ShivamKhantwal94
    @ShivamKhantwal94 3 ปีที่แล้ว +2

    Bhai pyara padhate ho 🔥⭐

  • @rishavkavlog
    @rishavkavlog 3 ปีที่แล้ว +1

    Bhaiya aap bhi thora channel promote kijiye, brand kijiye, post daliye linkedIn , college ke telegram channel me lecture ke link share kijiye..
    Aap itne ache samjhate ho fir bhi subscriber itne kum..
    Dekha nii jata

  • @zeta_meow_meow
    @zeta_meow_meow ปีที่แล้ว +1

    Liked it v

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

    can we solve the problem using Backtracking .. but instead of for loop we only use 2 times function call .. something like
    ds.push_back(i)
    function (arguments)
    ds.pop_back()
    function (arguments)
    we haven't used any for loop ..
    i am really confused , both the solutions are there .. plzz help

  • @PROTECHRAHUL
    @PROTECHRAHUL 2 ปีที่แล้ว +1

    Bhai please answer karna .
    Mei bhot pareshaan ho gya hu recursion kaise sikhu please btao mei relation nhi dhund pata hu shayd concept sahi se samj nhi aaya h can you please make a video on how to learn recursion from extreme scratch.
    Please Bhaiyaa.

    • @CodingWithPrakash_
      @CodingWithPrakash_  2 ปีที่แล้ว +1

      Dp vali playlist mai mai recursion kra rha hu basics se vo dekh lo

    • @PROTECHRAHUL
      @PROTECHRAHUL 2 ปีที่แล้ว +1

      @@CodingWithPrakash_ ok Bhaiyaa dekhta hu.
      Thode tips dedi bhai ise sikhne k liye
      Or Bhaiyaa iss playlist aise questions add krna jisse recursion sikhne me bhot help ho

  • @shankarmahawar7987
    @shankarmahawar7987 3 ปีที่แล้ว +1

    Sir muje javascript pe samjado plz mere all string combination sikhna he mere samaj nhi aya java programming me....
    Javascript me ek video nhi he

    • @CodingWithPrakash_
      @CodingWithPrakash_  3 ปีที่แล้ว

      Shankar concept sikho bus
      Code khu kro
      Interview mai bus intuition kaam aata hai

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

    Next time use normal standard font.. it's hard to read this one

  • @shindepranjal5782
    @shindepranjal5782 2 ปีที่แล้ว +1

    Refer Adiya Verma recursion playlist
    Thank me later

  • @HanhThe-vr6gi
    @HanhThe-vr6gi ปีที่แล้ว

    XIN Thường niệm nam mô ngọc hoàng thượng đế vô cực đại thiên tôn nam mô a di đà phật nam mô quán thế âm bồ tát

  • @soldiers4838
    @soldiers4838 2 ปีที่แล้ว +1

    Aap se contact kese kr sakte hai

  • @shivamsinha5554
    @shivamsinha5554 2 ปีที่แล้ว +1

    bhaiya yaha pe copy kyu kr rhe h wo nii samj aya mene bina copy kiye kiya to galat aggya answer

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

      Bataiye na bhaiya copy kyu kiya? Stuck hu bhut der se espe

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

      Me apki sari videos dekhta hu yehi h jo samj nii aya

    • @shivamsinha5554
      @shivamsinha5554 2 ปีที่แล้ว +1

      Direct agar list.add(curr ) kr dete h to nii ata kyu

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

      List ke andar curr list overwrite hoti hai
      Iskiye we make new array list and copy curr to it then we add in main list
      Reference and variable ka concepts padh lo net pe java ka

    • @shivamsinha5554
      @shivamsinha5554 2 ปีที่แล้ว +1

      @@CodingWithPrakash_ ok bhaiya mene Java me switch kiya h krna to thoda confuse tha ab samjha c++ me ye krne ki jarurat nii h na?

  • @mhj.xd7
    @mhj.xd7 ปีที่แล้ว

    areeh bai
    kya samjaya

  • @Ankitsingh-my1vu
    @Ankitsingh-my1vu 3 ปีที่แล้ว +2

    Not a good way to explain

  • @raj-nq8ke
    @raj-nq8ke 2 ปีที่แล้ว +1

    very good explanation.