After understanding the technique and logic of the 1st problem I solved the 2nd problem myself without even watching your logic and solution. Thanks for giving me the confidence, Sir. Hope you get well soon. Like you, I am also sick right now and pushing hard towards recovery but I made sure to watch your videos and practice coding myself😊
In this and in the DP series, the examples chosen and the sequence in which they have been taught is very logical hence it helps build the concept and the ideas very well. Kudos!
aapp jaldi se thikk ho jao bhaiya ☺️ ❤️ me to Blindly trust ke sath aapki video dekhta hoo. everyday jaldi se video dekh kar next video ke liye ready rahta hoooo😃 you give us consistency & made us consistent. dill se shukriya ❤️
Me (after watching every promotional parts) : jab aapki dukaan pe free me Shahi Paneer mil raha ho to paisa deke maggie khane koun jaae... 😅😅😅 Thank you bhaiya....💯💯💯💯🌸🌺🌻🌹🌷🌼💐 Itna achha course banane ke liye.. Get very well soon..
Phli baar mei samajh nahi aya tha bhaiya, but second time dekha and khud se notebook mei dry run jab kiya toh maja hi agaya solve krke, dusri wali toh khud se hi hogayi! Thank you so much!
Bhaiya, apka Josh high rakho. Ham log apke videos regularly dekhte hain. Aap hi hamka sahara ho. U r doing great!!! Also, backlog khatam kar raha hu. Din ke 2 videos dekh hi leta hu....
At first i didn't get the concept at all but after watching this video again after a day now i feel confident and learn this new concept of backtracking.
if we are not popping out at any time. how are we getting the subsets? The subset problem code will create vector output of redundant values. Leetcode also not catched it. I request leetcode to check it again.
Thanks bhaiya, apki waja se ye backtracking samaja aaya, ye bohot dino se samjne ka kosis kar raha tha lekin nhi aaya, sirf apki ye ek video ke waja se aaya, thanks bhaiya
really so easy question because of you, i taught this concepts of various teacher but cant understood how it's work but today, my all doubts is so clear thankyou Babbar bhaiya love you so much
If there is a question that will tell that print all the subsequence with the empty string then it will be 2 to power n otherwise your answer is correct
Hum padh rhe hai bhaiya❤, aap chinta mat karo..Aap please videos daalte raho..Aap apna 100% do, hum apna 200% dene ko tayaar hai..🔥 Jo bacche videos nhi dekhre abhi.... Wo pakka pichli waali videos ko kar rhe honge abhi bhi..aap chinta mat karo..sab time k saath raftaar pakad lenge... Aap bas 17 march tak khatam kar dena..hum placement lagwake aapko jaldi hi Khushkhabri sunaaynge Mail pe❤ 😇
Bhaiya dry run kar diya karo pls, usse bahot jyada clarity milti hai aur approach jyada din tak yaad bhi rehta hai, average studnts ki need hai voh, usse spoon feeding mat consider karo please.
Why am I always afraid of facing these kind of problems ?? so sad, this problem is too hard to derive the logic, he didn't even say how can we take the observation from output?
class Solution { public List subsets(int[] nums) { List temp = new ArrayList(); List ans = new ArrayList(); solve(nums,ans,temp,0); return ans; } public void solve(int[] nums,List ans,List temp,int idx){ if(idx>=nums.length){ ans.add(new ArrayList(temp)); return; } solve(nums,ans,temp,idx+1); temp.add(nums[idx]); solve(nums,ans,temp,idx+1); temp.remove(temp.size()-1); } }
How's the Josh? ... Very high bhaiya.... aise hi content laate rehne... humare saath saath corona bhi ... apka baat mann jayga... Hoping for a soon recovery... #WeLoveBabbar
Samaj aaya bhaiya.... bhaiya you told you are very good in aptitude.... so plz think about that also bhaiya... because the way you teach it is super understandable....
Incase of Java users, be careful, it wont work without backtracking... public List subsets(int[] nums) { List subsets = new ArrayList(); List subset = new ArrayList(); int index = 0; solve(index,nums,subset,subsets); return subsets; } private void solve(int index, int[] nums, List subset, List subsets) { System.out.println("Index: " + index + " " + subset); if(index >= nums.length){ System.out.println("Index: " + index + " " + subset + " PUSHED"); subsets.add(new ArrayList(subset)); return; } solve(index+1,nums,subset,subsets); subset.add(nums[index]); solve(index+1,nums,subset,subsets); System.out.println("Backtracking!"); subset.remove(subset.size() -1); }
Solution in Java class Solution { public List subsets(int[] nums) { List result = new LinkedList(); List output = new LinkedList(); findSubsets(nums, 0, result, output); return result; } private void findSubsets(int[] nums, int index, List result, List output){ if(index==nums.length){ result.add(new LinkedList(output)); return; } //Include output.add(nums[index]); findSubsets(nums, index+1, result, output); //Exclude output.remove(output.size()-1); findSubsets(nums, index+1, result, output); } }
Bhaiya maja aa gya ++ PS : bhaiya yei bateyi muje ek doubt h aapne subset wale problem m backtracking q ni ki after including the element bcoz Mera backtracking ka vode chal rha h or apka bhi ?
thankyou so much bhaiya by the way vector easy hai use karna baki normal array ke case mai thora jada mehanat hai thora sa jada utna bhi nhi bhot easy code tha