6 Permutation of Strings | Simple Recursion

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

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

  • @utkarshhSharmaa
    @utkarshhSharmaa ปีที่แล้ว +65

    finally landed in Google just bcoz of this man. Huge credit goes to this man for helping me out through this whole journey💪❤️

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

      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

    • @akhilnerella5491
      @akhilnerella5491 11 หลายเดือนก่อน +4

      Any suggestions for graphs playlist

    • @utkarshhSharmaa
      @utkarshhSharmaa 11 หลายเดือนก่อน

      @@akhilnerella5491 yeah you can refer striver's playlist for graph. It might help u.

    • @utkarshhSharmaa
      @utkarshhSharmaa 10 หลายเดือนก่อน

      @@akhilnerella5491 watch striver videos for graph. it might help u.

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

      @@diyashabose5319 Did you get it?

  • @shankysays
    @shankysays 9 หลายเดือนก่อน +14

    38:52 this is the most unexpected prompt 😂😂😂😂. She's damn cute though... 🥰 Galat falat bhi padhati tab bhidhek leta maan maar ke. 😂

  • @rishabhahuja7413
    @rishabhahuja7413 ปีที่แล้ว +26

    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!

  • @mohit6215
    @mohit6215 ปีที่แล้ว +226

    Vote ✋️for Graphs playlist.

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

      chodd do bhai nahi aane wali

  • @AbhaySingh-id9yh
    @AbhaySingh-id9yh 2 หลายเดือนก่อน +3

    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.

  • @harshitanand8216
    @harshitanand8216 ปีที่แล้ว +8

    You are the best on TH-cam. You deserve some national award

    • @mohitjain5552
      @mohitjain5552 9 หลายเดือนก่อน

      I second that.

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

    Bro you are op 💪..
    Big fan from Bangladesh ❤

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

    Thanks so much Aditya for explaining with such clarity and simplicity. Could you please consider doing series on Graphs and Greedy approach. Thanks

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

    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

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

    Thank you Sir 🎉🎉

  • @AqibAli-te2fi
    @AqibAli-te2fi 5 หลายเดือนก่อน

    very underrated , helped alot thanks...

  • @abhishekagarwal17
    @abhishekagarwal17 9 หลายเดือนก่อน +3

    There is a problem with the volume of videos. Please fix it in future videos. Can't hear anything on the speaker.

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

    Bhaiya plzz make a playlist for graphs also

  • @pawansingh.24
    @pawansingh.24 ปีที่แล้ว +8

    Bhai video jaldi dal Diya kro bhai request hai

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

    Return subsets of sum k me backtracking lagegi kya bhaiya q ki recursion se solve ni ho rhi

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

    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.

  • @643kanavguleria9
    @643kanavguleria9 11 หลายเดือนก่อน +2

    subscribed 😁

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

    Nice explanation

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

    Thanks aditya bhai

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

    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

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

    Ye outro par kya tha byi 😮😮😮😮😮😮😮
    Btw, Wonderful explanation 👏 👌

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

    Bhai plz upload next lecture😢

  • @asabutterfield3622
    @asabutterfield3622 ปีที่แล้ว +11

    jenny is cute👍❤

  • @krukiheight
    @krukiheight ปีที่แล้ว +6

    Bhai after Backtracking please Linked List …. Please please 🙏 please 🙏

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

      Striver...

    • @krukiheight
      @krukiheight ปีที่แล้ว +5

      @@rushiprajapati4597 bro there is big difference between this person and striver

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

    GOAT.

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

    thank you.

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

    content is best but the sound is very low, facing low volume issues when using earphones even at high volume

  • @abhayjoshi362
    @abhayjoshi362 ปีที่แล้ว +6

    Jenny cute to hai bhaiya🫠

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

    Abhi padhna khatam hua tha , ab kal hi padhunga 😮

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

    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;
    }
    };

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

    thanks bhaiya!!!!

  • @KaifKhan-sb2yr
    @KaifKhan-sb2yr ปีที่แล้ว +1

    if possible then please provide codes also

  • @sonuyadav-z3z1z
    @sonuyadav-z3z1z หลายเดือนก่อน

    29:52 chama Cham code

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

    bhai iss video ki volume thodi kam h

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

    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 .

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

    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

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

      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

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

      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)

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

    Last me jenny wala personal tha 😅

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

    Bhaiya aapki voice change ho gai hai

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

      uska bhai recording kar raha hei.. 100%.. He is not Aditya .. too many typo mistakes.. not clean code.

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

      @@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

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

    jenny😂😂

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

    jenny is cute hahahahaaahaaa

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

    🫡🫡🫡🫡....

  • @shreyxnsh.14
    @shreyxnsh.14 5 หลายเดือนก่อน

    outro thoda kazual hai :P