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.❤️
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 :)
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 :)
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
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); }
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.
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
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)
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
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
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_ 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
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
✅ Useful Links
𝐈𝐧𝐬𝐭𝐚𝐠𝐫𝐚𝐦 - instagram.com/codingwithprakash/
𝐖𝐡𝐚𝐭𝐬𝐀𝐩𝐩𝐂𝐡𝐚𝐧𝐧𝐞𝐥 - whatsapp.com/channel/0029VaACtTa4tRrpDCQc5f44
𝐋𝐢𝐧𝐤𝐞𝐝𝐢𝐧 - www.linkedin.com/in/prakash-shukla/
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.❤️
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 :)
ya i felt the same
Man .. I don't know how and why I missed this all these days. This cleared many things for me
bro pls complete your other playlists like u did for backtracking, u r a really gr8 teacher
Nice explanation. Plz bring this kind of challenging leetcode ques. Request to all viewers support him by watching ads without skipping it.
Thnx
Full playlist coming backtracking In 7 days
@@CodingWithPrakash_ Can I get the link of full playlist of backtracking?
Go to channel page
I loved the explanation sir!
Thank you soo so much!
Awesome. Best backtracking playlist in India.
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 :)
Best tutorial for recursion and subset.
Quality Content , you are a great teacher.
Nice explanation, touching upon all the essential points
best and the most simple explanation so far!
Thnx
Wow !! This question seemed so difficult to intuite, and now it looks like a piece if cake
Best video ever on subsets. I understand backtracking of subset very easily
Nice explanation 👍👍
woww,, what a great way of teaching ,, majja hi aa gaya samj ke thank you bahiyaa!!
Thank a ton Brother...........We need teachers like you.........🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻
Very Nice Explanation, With the help of animation it was lot more easy to understand .
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
excellent videos. Never found such a good playlist. appreciate your help
big brother lot of thanks......
cleared many doubts ❤
are sir maja hi aa gaya
explanation sun ke hi code ho gaya
now I am able to visualize little bit more
Solved my all doubts 👌
Nice explanation ... Easy to understand
Thanks
Nicely Explained Prakash. Great Job 👍
Thanks bhaiya for amazing content
Explanation is wonderful...
very nice explanation sir
helpful, quality,quantity,thank you.
Amazing solution.
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
Great Shukla Ji
Salute bro
Nice explanation 👏👏👏
badhiya bhai, nice explanation
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.
You can say that
@@CodingWithPrakash_ okay, thanks.
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);
}
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.
Nhi kra cover
Bahut achcha bataya aapane
Finest explanation..
GREAT!
If both approach has same time complexity (n*2^n) then why recursive approach shows more time on leetcode🤔
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
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)
I’m getting the repetitive elements and list in the result set
Bhai pyara padhate ho 🔥⭐
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
Apne time aaega
Liked it v
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
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.
Dp vali playlist mai mai recursion kra rha hu basics se vo dekh lo
@@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
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
Shankar concept sikho bus
Code khu kro
Interview mai bus intuition kaam aata hai
Next time use normal standard font.. it's hard to read this one
Refer Adiya Verma recursion playlist
Thank me later
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
Aap se contact kese kr sakte hai
Linkedin and Instagram
bhaiya yaha pe copy kyu kr rhe h wo nii samj aya mene bina copy kiye kiya to galat aggya answer
Bataiye na bhaiya copy kyu kiya? Stuck hu bhut der se espe
Me apki sari videos dekhta hu yehi h jo samj nii aya
Direct agar list.add(curr ) kr dete h to nii ata kyu
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
@@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?
areeh bai
kya samjaya
Not a good way to explain
I will try my best in next video
very good explanation.