Hey, my interview is going to be scheduled at Google in a few weeks, can you please share your email id or any contact info. As you have given interview recently, need some guidance. Thanks
Highly appreciate your return. Your expertise in Graphs, Trees, and Backtracking is invaluable. While Trees might come naturally to you, it's challenging for beginners like us. Your teaching approach encourages us to elevate our thinking. Please cover Graph and Trees after addressing Backtracking as companies are coming for college placements. Your contribution would greatly benefit the community. Thanks!
00:02 Introducing the intersection of strings in backtracking. 01:50 Simple recursion can solve permutation problems, but it may be slow. 05:17 Recursion helps generate permutations of strings 07:05 Understanding the concept of permutation and recursion 10:42 Understanding permutations using recursion 12:41 Understanding unique permutations and duplicates in string permutations. 16:14 Understanding the process of removing duplicates using recursion 17:53 The number of choices is dependent on the size of the string 21:23 Creating a permutation function using recursion and vectors. 23:13 Understanding base conditions and choices for permutation of strings 26:19 The substringing method in recursion explained. 28:05 The video explains the process of permutation using recursion. 31:34 Understand the process of making recursive calls in permutation of strings 33:20 Recursive approach to generating permutations of strings 36:26 Using recursion and backtracking to solve string permutation problems. 38:12 Understanding backtracking and time complexity Crafted by Merlin AI.
bhai try to include these vids : Knight Tour Remove Invalid Parentheses Word Break Problem using Backtracking Print all Palindromic Partitions of a String Find Shortest Safe Route in a Path with Landmines Partition of Set into K Subsets with Equal Sum Backtracking set-7 hamiltonian cycle tug-of-war Maximum Possible Number by doing at most K swaps Backtracking set-8 solving cryptarithmetic puzzles Find paths from corner cell to middle cell in maze Arithmetic Expressions
Hello Bhaiya. You've said many a times that you would make a video on your flipkart interview experience telling about all the questions that were asked in different rounds. Please make video on that as well.
Here is my solution, I did not used set, instead I used one logic to avoid using set and hence decrease in the space complexity. class Solution { void solve(vector &ans, vector &nums, vector &temp){ if(temp.size() == nums.size()) { ans.push_back(temp); return; } for(int i=0;i0 && nums[i] != nums[i-1]))){ temp.push_back(nums[i]); int num = nums[i]; nums[i] = -99; solve(ans,nums,temp); nums[i] = num; temp.pop_back(); } } return; } public: vector permuteUnique(vector& nums) { vector ans; vector temp; sort(nums.begin(),nums.end()); solve(ans,nums,temp); return ans; } };
why this is not working? for without repeated char public static void permute(String up,String p){ if(p.length()==0) { System.out.println(up); return; } for(int i=0;i
because your are not creating new variables up' and p' inside for loop before calling recursion. As he said in the video, if you are trying to solve this using only recursion, then you have to create new variables before calling because in this way child's variables do not affect parent's variables (He has done this in all of his Recursion videos, created op1 and op2 and called recursion on new output and modified input) Understand like this, if f(n) calls itself for f(n-1) and f(n-2), since recursive tree is solved in preorder fashion, first f(n-1) will be solved and after it returns to f(n), then f(n-2) is called so once I've completed my work for f(n-1) I have to revert the changes made in f(n-1) because only then I'll be able to call f(n-2), this is called Backtracking step. If we do not do this, changes done in f(n-1) step will reflect while calling f(n-2) which will give wrong result. In your implementation, the values of parameters in f(n) call is changed as you've called for new input and output but didn't create new variables so change is reflected in parent call due to which next calls will not generate intended output. For your code to work, you have to add backtracking step that is, add back the character at i to p (input string) and remove the character from up (output string)
@@mit5851 how do you know that..? Do you think will he ever do that.. He is one of the honest persons we saw in his teaching style so from there we can atleast believe 🙏 he is there not his brother
finally landed in Google just bcoz of this man. Huge credit goes to this man for helping me out through this whole journey💪❤️
Hey, my interview is going to be scheduled at Google in a few weeks, can you please share your email id or any contact info. As you have given interview recently, need some guidance. Thanks
Any suggestions for graphs playlist
@@akhilnerella5491 yeah you can refer striver's playlist for graph. It might help u.
@@akhilnerella5491 watch striver videos for graph. it might help u.
@@diyashabose5319 Did you get it?
38:52 this is the most unexpected prompt 😂😂😂😂. She's damn cute though... 🥰 Galat falat bhi padhati tab bhidhek leta maan maar ke. 😂
Highly appreciate your return. Your expertise in Graphs, Trees, and Backtracking is invaluable. While Trees might come naturally to you, it's challenging for beginners like us. Your teaching approach encourages us to elevate our thinking. Please cover Graph and Trees after addressing Backtracking as companies are coming for college placements. Your contribution would greatly benefit the community. Thanks!
Vote ✋️for Graphs playlist.
chodd do bhai nahi aane wali
00:02 Introducing the intersection of strings in backtracking.
01:50 Simple recursion can solve permutation problems, but it may be slow.
05:17 Recursion helps generate permutations of strings
07:05 Understanding the concept of permutation and recursion
10:42 Understanding permutations using recursion
12:41 Understanding unique permutations and duplicates in string permutations.
16:14 Understanding the process of removing duplicates using recursion
17:53 The number of choices is dependent on the size of the string
21:23 Creating a permutation function using recursion and vectors.
23:13 Understanding base conditions and choices for permutation of strings
26:19 The substringing method in recursion explained.
28:05 The video explains the process of permutation using recursion.
31:34 Understand the process of making recursive calls in permutation of strings
33:20 Recursive approach to generating permutations of strings
36:26 Using recursion and backtracking to solve string permutation problems.
38:12 Understanding backtracking and time complexity
Crafted by Merlin AI.
You are the best on TH-cam. You deserve some national award
I second that.
Bro you are op 💪..
Big fan from Bangladesh ❤
Thanks so much Aditya for explaining with such clarity and simplicity. Could you please consider doing series on Graphs and Greedy approach. Thanks
bhai try to include these vids :
Knight Tour
Remove Invalid Parentheses
Word Break Problem using Backtracking
Print all Palindromic Partitions of a String
Find Shortest Safe Route in a Path with Landmines
Partition of Set into K Subsets with Equal Sum
Backtracking set-7 hamiltonian cycle
tug-of-war
Maximum Possible Number by doing at most K swaps
Backtracking set-8 solving cryptarithmetic puzzles
Find paths from corner cell to middle cell in maze
Arithmetic Expressions
Thank you Sir 🎉🎉
very underrated , helped alot thanks...
There is a problem with the volume of videos. Please fix it in future videos. Can't hear anything on the speaker.
Bhaiya plzz make a playlist for graphs also
Bhai video jaldi dal Diya kro bhai request hai
Return subsets of sum k me backtracking lagegi kya bhaiya q ki recursion se solve ni ho rhi
Hello Bhaiya. You've said many a times that you would make a video on your flipkart interview experience telling about all the questions that were asked in different rounds. Please make video on that as well.
subscribed 😁
Nice explanation
Thanks aditya bhai
C++ code || Using SET
void permute(string ip,string op,vector &v){
if(ip.size()==0){
v.push_back(op);
return;
}
unordered_set mp;
for(int i=0;i
Ye outro par kya tha byi 😮😮😮😮😮😮😮
Btw, Wonderful explanation 👏 👌
Bhai plz upload next lecture😢
jenny is cute👍❤
Bhai after Backtracking please Linked List …. Please please 🙏 please 🙏
Striver...
@@rushiprajapati4597 bro there is big difference between this person and striver
GOAT.
thank you.
content is best but the sound is very low, facing low volume issues when using earphones even at high volume
Jenny cute to hai bhaiya🫠
Abhi padhna khatam hua tha , ab kal hi padhunga 😮
Come on bro you can do it now
@@lofi_feels1924Hehe😂
Here is my solution, I did not used set, instead I used one logic to avoid using set and hence decrease in the space complexity.
class Solution {
void solve(vector &ans, vector &nums, vector &temp){
if(temp.size() == nums.size()) {
ans.push_back(temp);
return;
}
for(int i=0;i0 && nums[i] != nums[i-1]))){
temp.push_back(nums[i]);
int num = nums[i];
nums[i] = -99;
solve(ans,nums,temp);
nums[i] = num;
temp.pop_back();
}
}
return;
}
public:
vector permuteUnique(vector& nums) {
vector ans;
vector temp;
sort(nums.begin(),nums.end());
solve(ans,nums,temp);
return ans;
}
};
thanks bhaiya!!!!
if possible then please provide codes also
29:52 chama Cham code
bhai iss video ki volume thodi kam h
Bhaiya I highly appreciate if you speak a little slowly and clearly .this topic needs full concentration aur apka fast pace voice se toh dikkat hoti .
why this is not working? for without repeated char
public static void permute(String up,String p){
if(p.length()==0)
{
System.out.println(up);
return;
}
for(int i=0;i
private static List permute(String s) {
List ans=new ArrayList();
String op="";
solve(op,s,ans);
return ans;
}
private static void solve(String op, String s, List ans) {
if(s.length()==0) {
ans.add(op);
return;
}
for(int i=0;i
because your are not creating new variables up' and p' inside for loop before calling recursion. As he said in the video, if you are trying to solve this using only recursion, then you have to create new variables before calling because in this way child's variables do not affect parent's variables (He has done this in all of his Recursion videos, created op1 and op2 and called recursion on new output and modified input)
Understand like this, if f(n) calls itself for f(n-1) and f(n-2), since recursive tree is solved in preorder fashion, first f(n-1) will be solved and after it returns to f(n), then f(n-2) is called so once I've completed my work for f(n-1) I have to revert the changes made in f(n-1) because only then I'll be able to call f(n-2), this is called Backtracking step. If we do not do this, changes done in f(n-1) step will reflect while calling f(n-2) which will give wrong result.
In your implementation, the values of parameters in f(n) call is changed as you've called for new input and output but didn't create new variables so change is reflected in parent call due to which next calls will not generate intended output.
For your code to work, you have to add backtracking step that is, add back the character at i to p (input string) and remove the character from up (output string)
Last me jenny wala personal tha 😅
Bhaiya aapki voice change ho gai hai
uska bhai recording kar raha hei.. 100%.. He is not Aditya .. too many typo mistakes.. not clean code.
@@mit5851 how do you know that..? Do you think will he ever do that.. He is one of the honest persons we saw in his teaching style so from there we can atleast believe 🙏 he is there not his brother
jenny😂😂
jenny is cute hahahahaaahaaa
🫡🫡🫡🫡....
outro thoda kazual hai :P