L12. Print all Permutations of a String/Array | Recursion | Approach - 1

แชร์
ฝัง
  • เผยแพร่เมื่อ 22 ส.ค. 2024
  • Check our Website:
    In case you are thinking to buy courses, please check below:
    Link to get 20% additional Discount at Coding Ninjas: bit.ly/3wE5aHx
    Code "takeuforward" for 15% off at GFG: practice.geeks...
    Code "takeuforward" for 20% off on sys-design: get.interviewr...?_aff=takeuforward
    Crypto, I use the Wazirx app: wazirx.com/inv...
    Take 750 rs free Amazon Stock from me: indmoney.oneli...
    Earn 100 rs by making a Grow Account for investing: app.groww.in/v...
    Linkedin/Instagram/Telegram: linktr.ee/take...
    ---------------------------------------------------------------------------------------------------------------------------------------------------- I have decided to make a free placement series comprising of video lectures(C++ and Java) on the entire SDE sheet.. ✅(bit.ly/takeUfo...)
    ✅Entire Series: bit.ly/placemen...
    ✅Problem Link: leetcode.com/p...
    C++/Java Code: takeuforward.o...
    Access all the Free Live Classes here: unacademy.cc/da...
    Batch for Beginners starting 8th March (Check Course plan) : bit.ly/beginner...
    Batch for Intermediates started 4th March: bit.ly/batchascend
    Free Test (Exciting prizes for Winners): bit.ly/deadheat...
    ✅This is where I teach: ----- Use coupon-code "TAKEUFORWARD" for getting 10% on my course at GFG: bit.ly/striver_...
    ✅Use coupon-code "TAKEUFORWARD" for getting 10% for all GFG courses: bit.ly/tuf_gfgC...
    If you appreciate the channel's work, you can join the family: bit.ly/joinFamily
    Thumbnail Creator: / rikonakhuli
    ✅ Striver's Linkedin Profile: / rajarvp
    ✅ Instagram: / striver_79
    Connect with us: t.me/Competiti... (Use Link in Mobile only, if not works search "takeUforward" in telegram)..
    #dsa #leetcode #placements

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

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

    it's very rare to find such explanations of recursion! Striver and Aditya Verma both are the best when it comes to recursion! Thanks for making recursion easy :)

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

      Yaar dono hi aiseee.... tree method se padhayenge na ?
      Bas iye bta do

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

      @@sayantaniguha8519 yes

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

      you shoud chack kunal kuswaha recursion.

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

      @@puspendragaming6352 He isn't that good. I honestly understood from Striver more than Kunal a thousand times;

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

      Striver is best

  • @samlinus836
    @samlinus836 ปีที่แล้ว +34

    ATTENTION
    Are you wondering, why it is ans.add(new ArrayList(ds)); instead of ans.add(ds);
    If you are using ans.add(ds); ds is passed as shallow copy.. the lists will be added to ans appropriately
    BUT as we remove the elements from the list ds since it is a shallow copy it will also be reflected in ans list
    Hope this made sense😁

    • @samagraagrawal5333
      @samagraagrawal5333 9 หลายเดือนก่อน +4

      This is something we don't see in cpp. Due to which many new java users get confused by it. Thanks for this clear explanation

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

      Thanks alot bro........

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

      didn't understand? shallow copy is mentioning the same list with different reference, i.e both are dependent, if you modify one , it will be reflected in other reference also, because of using same list, just different referencing!

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

      i code in cpp, but my interviewer asked me to code in java(as i applied for java role) so i missed this step and i got nothing in result, thanks for the explanation:)

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

    FOR THOSE, who are not getting "Why we are removing the last element after the recursive call ?". Objects like (Arrays, Maps, Custom class objects etc- all objects) in most programming languages are passed by reference in the function call unlike plain variables (int, char etc), so when you are passing the list/array to the recursive call, any updation(add/remove) on the object will be retained even after the function call finishes. Since for the right/other subtrees (of recursion call) we are not considering the same element. So we need to remove it explicitly.
    If you would have passed the new replica/instance of the data structure in every recursive call, then this was not required. Hope this clears the doubt.

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

      Is string also passed by reference in c++??

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

      @@nirnayjain7097 ya

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

      nope ur wrong in c++ vectors are not passed by refrence arrays are. So in this code u can omit the popback function if u dont pass the vector by reference but in order to improve upon the space complexity it is better to pass the vector by reference hence the use of the pop function

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

      @@codingachinilgtifirbhikrrh9009 I am generalising here, not talking of any specific programming language.

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

      ​@@codingachinilgtifirbhikrrh9009 The pop function has to be included regardless since we have a for loop we don't want ds from the previous iteration to reflect in the next. We could have omitted the reference for ds though but no point in doing that since we need to save up some space.

  • @SAURABHSINGH-xp8dm
    @SAURABHSINGH-xp8dm 2 ปีที่แล้ว +13

    Great explanation. U r the lord of Data structure and Algorithm. I sometimes wonder how you understand recursion so beautifully. This is not my cup of tea, if you are not there. Your channel is helping me a lot in understanding advance topics of DSA. I will always be thankful to you

  • @HarshSingh-qq2jf
    @HarshSingh-qq2jf ปีที่แล้ว +7

    I came up with the exact 100% logic and code though it took me 3-4 hours but I am so happy that I did solve the problem before looking the approach or the solution all because of the previous problems of the playlist and the beautiful explanation by striver... Though, I could not think of the next approach that is swap, I could only think of the boolean approach

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

    faced many difficulties when i am following another source for recursion but after learning from u now I am clear with recursion questions and also able to solve this question myself in 10 minutes thanks striver for the amazing content......

  • @SWATISINGH-im6rd
    @SWATISINGH-im6rd 2 ปีที่แล้ว +5

    very well understood, Initially i was not able to solve recursion ,Dynamic programming problem.But now i am able to do that all , by just following your playlist.

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

    Please leave a small comment if you understand by spending your time here, every comment motivates me more :)
    C++ Code: github.com/striver79/SDESheet/blob/main/permutationsCppApproach-1
    Java Code: github.com/striver79/SDESheet/blob/main/permutationsJavaApproach-1
    Approach-2 Video Link: th-cam.com/video/f2ic2Rsc9pU/w-d-xo.html
    Instagram(For live sessions): instagram.com/striver_79/

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

      Hi!!

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

      1 question, why we are using ds.remove(ds.size() -1). Why not use ds.remove(nums[i]) ?

    • @RohitKumar-hh7uu
      @RohitKumar-hh7uu 2 ปีที่แล้ว +2

      @@TheMa11nu Since, we only want to remove the value which we added, at last, hence we are using ds. remove(ds. size() - 1). As ds.remove() considers integer value as parameter(index) hence, it will consider that the value you are passing inside remove(nums[i]) is the index, not the value, hence it will remove the incorrect element instead of the last index value & may even give you an error in case value of nums[i] is more than length of ds - 1. Even if you want to remove it by value in that case it will remove first occurrence of that particular value, & in case we have multiple occurrences of that value it will not remove the element from the last index instead it will remove the first occurrence hence your output will be wrong.

  • @037_sayedramishali7
    @037_sayedramishali7 3 ปีที่แล้ว +13

    The reccursion tree is really helpful thank u bhaiya🙏

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

    insted of creating int freq[nums.size()]={0} make itin vector as vectormap(nums.size(),0);

  • @akshayvishwakarma188
    @akshayvishwakarma188 8 วันที่ผ่านมา

    thank you sir, well explained!!, and the map technique with just using an array was genius

  • @soumojitkoley7154
    @soumojitkoley7154 23 วันที่ผ่านมา

    using C++ STL
    vector permute(vector& nums) {
    vector ans;
    sort(nums.begin(),nums.end());
    do{
    ans.push_back(nums);
    }while(next_permutation(nums.begin(),nums.end()));
    return ans;
    }

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

    Thanks, Raj you don't know how much you help college students like me. This explanation was mind-blowing.

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

    Thank you so much brother now I'm able to solve recursions questions and also able to understand the behind of approach in recursion and backtracking
    Thank you so much You are amazing man.

    • @NikhilKumar-vf9vo
      @NikhilKumar-vf9vo 10 หลายเดือนก่อน

      the space complexity O(n !) is for the resultant vector. We are not considering that vector because we are not using it to solve our problem but we are using it to store the answer for our problem.
      AS for the O(N) + O(N) space, first is used to store the possible values of a single Permutation and the other space is for the Map which stores the frequency of element in the array which is used to check whether we had already taken that element in the current Permutation or not.
      Hope it helps!

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

    I hope you are doing extremely well bhaiya ❤️❤️

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

    bro wth, this got accepted on the first try without even looking at your pseudocode (beats 100% as well). Amazing work Striver!!!!

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

    afterall..... this is the first ever videos through which i grasp my recursion concept, jiyo striver jiyo

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

    Your PlayList for recursion is the best .

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

    ur explanation had taken me really forward in understanding this problem as well as recursion, HATS OFF to u and ur work ♥🔥🔥🔥

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

    UNDERSTOOD.......Thank You So Much for this wonderful video.......🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻

  • @SatyamKumar-bw4vi
    @SatyamKumar-bw4vi 2 ปีที่แล้ว +3

    Hare Krishna! Thanks Now I can solve the Problem

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

    Awesome video. Btw, we can reduce space complexity to O(1) by doing a[i] = -1 while including it and again restoring it during backtrack. It will do the same that map is doing but in O(1) time.😊

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

      Yes, we can, but we generally don’t modify the given arr..

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

      @@takeUforward Yeah, got the point! Thank you😁

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

      @@nitigya but it won't work if the array contains negatives as well :\

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

      @@rahulsrivastava1040 OP, in that case we can use Max(arr) + 1 or min(arr) - 1. But yeah, that can overflow if the max/min is upper limit. Your point is really nice.
      Thanks man!

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

    this channel is a gold mine

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

    what if the vector nums contains duplicate elements?...this method would print duplicate permutations as well....eg if the vector contains 1,1,2 then the vector ans would contain {1,1,2} , {1,1,2} , {1,2,1} , {1,2,1} , {2,1,1} and {2,1,1}.....how to remove duplicates without using sets?

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

      I faced the same problem. have you found any solution yet?

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

    public static void generatePermutations(int[] arr, int index, Map used, StringBuilder sb) {
    if (index == arr.length) {
    // All elements have been used, so we can print the permutation
    System.out.println(sb.toString());
    return;
    }
    // Try using each element in the permutation
    for (int i = 0; i < arr.length; i++) {
    // Skip elements that have already been used
    if (used.get(i)) {
    continue;
    }
    // Mark element as used and append it to the permutation string
    used.put(i, true);
    sb.append(arr[i]);
    // Generate permutations with the updated string
    generatePermutations(arr, index + 1, used, sb);
    // Backtrack: mark element as unused and remove it from the permutation string
    used.put(i, false);
    sb.deleteCharAt(sb.length() - 1);
    }
    }
    public static void main(String[] args) {
    int[] arr = {1, 2, 3};
    Map used = new HashMap();
    for (int i = 0; i < arr.length; i++) {
    used.put(i, false);
    }
    StringBuilder sb = new StringBuilder();
    generatePermutations(arr, 0, used, sb);
    }

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

    Instead of taking a frequency array of n length we should take a map as it will not work correctly for negative values constraints of leetcode . Thanks a lot for wonderful explanation.

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

    A day to remember me ...when i started ds u r channel is the best

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

    Easiest thing on the planet ...
    I love recursion

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

    Only man who can go par to par with adithya verma on recursion...truly awsome🤯

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

      I have seen both... Striver is much better

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

    Python Solution
    class Solution:
    def recursion(self,ans,mapp,ds,nums):
    # base case
    if len(ds)==len(nums):
    ans.append(ds.copy())
    return
    for i in range(len(nums)):
    if not mapp[i]:
    ds.append(nums[i])
    mapp[i]=1
    self.recursion(ans,mapp,ds,nums)
    mapp[i]=0
    ds.pop()
    def permute(self, nums: List[int]) -> List[List[int]]:
    # recursive solution of permutations using spaces
    ans = [] #to store all the permutations
    mapp = [0]*(len(nums)) # to mark the used elements
    ds = [] # to store the array
    self.recursion(ans,mapp,ds,nums)
    return ans

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

    Great Explanation. There is a good connectivity of the concepts which are taught in the earlier videos of this recursion playlist.

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

    Great explaination brother! I am really enjoying this series :) This will never get old ❤❤

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

    I will forward your channel name to those group of students & would invite them to come & comment on this video

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

    C++ code at 16:46

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

    Well this can be done in constant space if we just store the character which we are taking in our current permutation in temp variable and change the char by some dummy char or space and recursively call the same function while picking the char ensure that it is not a space. and while doing backtracking we can change the curr char to temp. so that our input string remains same.

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

    your video is one of the best video on youtube but i wish this could be in hindi language then it may be more clear to us
    by the way thanks for your effort

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

    Bhai bhai! Maaza aagya.. thanks for such easy explanation.

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

    No doubt video is good but just a suggestion - you should make the viewers see the sudo code first, so that they can get idea of the recursion tree flow. What happening now is that you are explaining the recursion tree at the start but the viewers might not be able to relate it.

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

    thanks thanks thanks alot striver I was facing so much issues in undertanding this problem saw other yt video explaination as well (but I couldn't understand their explaination properly ) but u made it very very simple thank you so much for what ever u r doing. Please keep on making such awesome videos bhai.

  • @AbhinavSingh-up7bl
    @AbhinavSingh-up7bl 10 หลายเดือนก่อน

    Just because of you I was able to do this question without even looking for solution and I was able to submit it on LeetCode within less than 20 min.....thnaks bhaiya
    ///////
    void solve(int idx, vector &nums, unordered_map ump, vector &ans, vector list)
    {
    if (list.size() == nums.size())
    {
    ans.push_back(list);
    return;
    }
    for (int i = 0; i < nums.size(); ++i)
    {
    if (ump[nums[i]] == 1)
    continue;
    list.push_back(nums[i]);
    ump[nums[i]] = 1;
    solve(i + 1, nums, ump, ans, list);
    list.pop_back();
    ump[nums[i]] = 0;
    }
    }
    class Solution {
    public:
    vector permute(vector& nums) {
    unordered_mapump;
    vectorans;
    vectorlist;
    solve(0, nums, ump, ans, list);
    return ans;
    }
    };
    /////

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

    Best Explanation. Backtracking is all about dry running the code. If you know the intuition behind the solving the problem, you will experience magic with backtracking.

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

    Amazing explanation :) very helpful to understand recursion. I was also thinking in this way but not getting implementation way. thank you so much

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

    Love the way you solve each and every problem.
    Kudos to you
    💯💯💯💯💯

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

    awesome, you are my best teacher

  • @raunakgupta4-yearb.tech.me278
    @raunakgupta4-yearb.tech.me278 2 ปีที่แล้ว

    bestest video I have watched till now for permuataions 🔥🔥

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

    I can understand your solution but when it comes to think of logic by myself its problem.when to use loop ,when only recursive calls no loop ,I cant differentiate

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

    Time and space complexity in 13:00

  • @user-cd7lf8nk4c
    @user-cd7lf8nk4c 2 หลายเดือนก่อน +1

    I think the time complexity will be O( n*(1+n+n*(n-1) + n*(n-1)(n-2)+........+n!) ) not O(n*n!)

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

    Ap great ho bhaiya hmm phele next permutation q krne gaye apki sheet ka vha permutation ki need padi to logic bna hi nahi....😔😔😔

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

    The excel sheet format was super useful.

  • @RAJPATEL-ir7ly
    @RAJPATEL-ir7ly ปีที่แล้ว

    Striver just used a form of dfs to find the permutations without even mentioning it
    THAT'S WHY HE IS THE G.O.A.T !!!! THE GOOOAAAT

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

    Approach is good but i have one doubt if there is backtracking so once will return from down to top then will call the next iteration

  • @yashwanthgowda1517
    @yashwanthgowda1517 23 วันที่ผ่านมา

    Instead of Using a array of freq[] , I think we need use a HashMap because its not necessary that the numbers are given from 0 to n always.

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

    thank you very much raj bhai

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

    Is there any hint or discretion on when to use 2 recursion call for pick and not pick AND recursion call in for loop. In this playlist there is another problem combination Sum 2 where unique and sorted subsets are derived using for loop with recursion. Please let me know if there is and basic rule that I am missing.

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

    Thanks Striver !

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

    Can someone please explain why sometimes we are passing loop's I in recursive call and sometimes we are passing index(from function parameter) to recursive calls. For example in
    in this question: recurPermute(index + 1, nums, ans);
    in combinations sum 2: findCombinations(i + 1, arr, target - arr[i], ans, ds);
    I am finding it hard to get the reason behind this? Please help.

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

      Yes, after a lot of struggle... Finally I figure out why in other cases they are using loop from index to n-1 but in this case they are using 0 to n-1 is because they in permutation at every step you need to move backward as well as in front direction... So in order to take care of backward part they start from 0 .... But in other question we do not need to move backward we need to focus only on the numbers which are coming next.... Not the previous one... So we directly start traversing from index to n-1

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

      @@anantkashyap2087 continuing in simpler terms, in combination/subsets problems we also sort them first, and then to get unique subsets like [1,2], if we did from id+1 else we would have got pairs like [2,1] as well.

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

    Thank you Raj Brother . elegant explanation with Rec tree.

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

    Thank You Striver , Was crystal clear video

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

    Shouldn't the time complexity be n^n ?
    As from the tree at each node we are haveing a loop of n (n branches), and depth of the tree would be n.

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

    RELEVEL charged 1.5Lakhs for it & poor people are yet clearing EMIs

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

    thank you bhaiya 👍🏼

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

    Thank you for the best explanation

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

    Thanks sir Understood everything

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

    "Understood!!"

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

    best explanation of recursion.

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

    very good explaination man

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

    Moving to L13 👍 Series is getting difficult with each video

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

    understood

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

    Understood ❤

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

    Time complexity at: 13:00

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

    Thank you sir

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

    Thank you

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

    Understood🔥

  • @Abhishek-tl1ul
    @Abhishek-tl1ul 2 ปีที่แล้ว

    Thanks Sir for the explanation

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

    I have taken dsa from coding ninjas....but explanation and theory sucks.i was frustated with recursion problems and their deadlines ....but i got your channel somehow now i m ok with recursion

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

    Love the way u explained 🔥🔥

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

    coded on my own...Thks striver

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

    Very Nice Explanation !

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

    i did the code myself and 😆 did the same code as in the end of video.

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

    How to get the approach of these difficult questions if we haven't seen them before?

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

      simple , First saw them

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

      @@vibhoragarwal5425 heheeheh

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

      Nobody can do that. It's all about solving similar question. Then only you can solve question on that topic. Solve atleast 15 question on each topics and revise them.

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

      @@vibhoragarwal5425 see *

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

    Understood, thank you.

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

    What an intutive solution 😍

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

    Striver OP💯

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

    great video. commenting for more reach

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

    Aa gya smjh

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

    Awesome explanation

  • @mohammadumaidansari5087
    @mohammadumaidansari5087 วันที่ผ่านมา

    Understood

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

    Kindly note that that for line no. 23 in your c++ solution, it shows an error in leetcode complier that Error: variable-sized object may not be initialized, Kindly clarify on this bhaiya pls

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

      Accepted code h bhai. Ekbr mera code chalao

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

      same did you find the error?

  • @spardha-yug
    @spardha-yug ปีที่แล้ว

    Thank you so much.

  • @KartikeyTT
    @KartikeyTT 14 วันที่ผ่านมา

    tysm sir

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

    Good explanation but why do you provide a different code on your website than what you explained in the video?

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

    Bhiaya I'm not able to code recursively in such questions.

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

    nice explanantion

  • @Sarkar.editsz
    @Sarkar.editsz 2 ปีที่แล้ว

    Thanks a lot , bhaiya

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

    In c++ code we do we need vector < vector < int>> permute ( vector & nums)
    And this
    vector < vector < int>> ans;
    Please someone explain

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

    excellent man keep it up

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

    Nice explanation

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

    Great explanation !!!!

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

    understood.