I always had a fear when it comes to find permutation, you have explained it in a very simple way. Thanks a lot!!!!
@lancema28944 жыл бұрын
Very clear explanation. Finally understand why we need the backtracking after the recall of permute. Thank you very much.
@techdose4u4 жыл бұрын
Welcome :)
@vcfirefox2 жыл бұрын
Love it. Time and time again, I come back to your channel when I need a REALLY good grasp of something that is not explained well in leetcode. Thank you!
@faizanzahid4905 жыл бұрын
Those who have tried coding knows the complexity of outputs for this case where elements of string is not repeating Thumbs up bro
@techdose4u5 жыл бұрын
Thanks :)
@mitchellbaylor81323 жыл бұрын
Pro trick : you can watch series at flixzone. Me and my gf have been using it for watching lots of of movies these days.
@graysonalan443 жыл бұрын
@Mitchell Baylor Definitely, have been watching on flixzone} for months myself =)
@hectorotis5123 жыл бұрын
@Mitchell Baylor Yup, been watching on Flixzone} for years myself :)
@alexanderamos99613 жыл бұрын
@Mitchell Baylor yup, have been using Flixzone} for since november myself :D
@bitbyte81774 жыл бұрын
Dude you know what, your method is the most intuitive method I have seen on youtube. Awesome job!!
@techdose4u4 жыл бұрын
Thanks :)
@nagalakshmichithambaranath11474 жыл бұрын
Yes true.
@rhishishrivastava6757 ай бұрын
You are a magician, you can make someone believe in himself/herself and not give up on dreams. God bless you.
@aayushsugandh40364 жыл бұрын
This perhaps used to be one of those problems, which I always use to try in my school life, but could never solve it using for loops, but now in grad life, it has changed!
@techdose4u4 жыл бұрын
:)
@swapnil11085 жыл бұрын
I saw this video and went on to explore your playlist and finally subscribed you..LOL. Awesome explanation. I wish you had a second part with DUPLICATE STRINGS.
@techdose4u5 жыл бұрын
Will do it later. I am loaded with question requests now :)
@JayDonga4 жыл бұрын
Your explanation of the permutation problem is better than most other explanations on the Internet.
@techdose4u4 жыл бұрын
Thanks :)
@Purple-e9c4 жыл бұрын
This is very helpful for me. Thank you. Very good presentation. Now I totally understand the string permutation. The dry run of algorithm is very helpful and impressive.
@techdose4u4 жыл бұрын
Thanks :) glad that you understood
@cityhunter14772 жыл бұрын
Thank you! I saw so many blogs and videos with the tree and the code separate. Yours was the first to connect the tree to the code directly! Now I can understand what the swaps are doing exactly and how the iteration works.
@techdose4u2 жыл бұрын
Nice 😊
@olgyish4 жыл бұрын
I was able to code this easily after watching your explanation. That was a great explanation.
@techdose4u4 жыл бұрын
Nice 😊
@m.p.3688 Жыл бұрын
I watched NeetCode explenation of this problem probably 5 times and could not understand how logic behind it actually relates to code solution. Watching this explenation helped me understand code behind the solution instantly, because logic presented in drawning explenation is simple and actualy demonstrates code logic.
@bhimsendabby4 жыл бұрын
I always confused with permutation, I mean how to implement permutation in coding but after your explanation, I got the logic of how to code this thank you Sir.
@techdose4u4 жыл бұрын
Welcome
@bhimsendabby4 жыл бұрын
@@techdose4u thanks a lot
@AparnaBushan Жыл бұрын
By far the best explanation of this problem on you tube. Thanks much!
@Goku-ri3tl7 ай бұрын
Amazing!! This worked like a charm )) at my first try I have been trying for many days different tutorials but no one explained as good and easy as you, Thank you so much
@techdose4u7 ай бұрын
Great :)
@sunilkumaryadav31942 жыл бұрын
This is for the first time I try to understand it and You nailed it. Thank you
@shreyasvishwakarma89793 жыл бұрын
Today is 2022 and you made this in 2019 . Like 3 year still 96.2k subscribers . You deseve 1M sadly you and i know indians love clickbait stuff . 96.2K shows you are best at teaching not at Clickbait . Keep up the good work sir : )
@techdose4u3 жыл бұрын
Thanks 😊
@asmartguycodename4721 Жыл бұрын
Shut up goofball
@jithiny69532 жыл бұрын
Very nicely explained. I saw many videos to understand this, but this was super clear
@aadridanand Жыл бұрын
from all the explanation this is one of the most easiest way one can explain,thanks👏👏
@shivamgupta32933 жыл бұрын
Everytime I found best explanation only in this channel. Thanks Man
@techdose4u3 жыл бұрын
Welcome :)
@feelgood01085 жыл бұрын
awesome explaination sir.Now I got clear understanding on what is backtracking.Thank you so much
@debasishpatnaik2944 жыл бұрын
Finally Understood it..thanks a lot for the detailed explanation of the algo..
@techdose4u4 жыл бұрын
Nice :)
@thesadanand65994 жыл бұрын
I am floored, dude u earned a sub...
@techdose4u4 жыл бұрын
Thanks :)
@SandeepGaneshD23BRS1074 ай бұрын
a tough concept simplified ... Thanks sir
@swanhtet12 жыл бұрын
This is the best explanation on this problem.
@duyle-ui4ul2 жыл бұрын
Best explaination I've ever took. Really appriciate it!
@rutachaudhari57744 жыл бұрын
Thank you so much, your explanation is very easy than others. Its very difficult to understand permutation with recursion, but this makes it easy
@techdose4u4 жыл бұрын
Thanks 😊
@ozzyfromspace4 жыл бұрын
I forgot how to write permutations but need to write such an algorithm for a project I'm doing in recreational maths. Thanks for explaining it :) I was thinking "recursion" so I'm glad you did that approach. I'm gonna write something up in python now
@techdose4u4 жыл бұрын
Good luck
@gpavansai72072 жыл бұрын
Thank You so much, your lecture is very clear and elaborative.
@samudrasen29353 жыл бұрын
Really wonderful explanation .all the doubts in string permutations got cleared.
@saisrisai96494 жыл бұрын
The best tutorial ever..
@techdose4u4 жыл бұрын
Thanks :)
@prateekrajput26463 жыл бұрын
you explained with god level
@techdose4u3 жыл бұрын
Thanks :)
@rohit2109955 жыл бұрын
I think this method won't work for duplicates. It will count the duplicates as separate characters. Eg.- ABAC. In this case total no. of permutations possible would be 12 (4!/2!). However, if we follow this method it will end up 24 (4!) combinations, simply because it counts the first and the second occurrence of A as different alphabets. Meaning - in ABAC, if A in the first place is swapped with A in third place we end up with the same string ABAC, whereas the above logic treats them as different. (This can be taken care of if we use a counter for each character).
@gkeranna35432 жыл бұрын
If you want to remove duplicates. just you will add all Strings into HasSet.
@georgesaab7609 Жыл бұрын
store all results in a vector of strings and then youd be able to filter the duplicates
@UnknownLearner-od3qn6 ай бұрын
your videos are always awesome and ofcourse so much informative & easy to understand ... Thnx 🙏🙏
@ranusingh8623 жыл бұрын
Best explanation I could ever get. 👏
@ashutoshbichare4 жыл бұрын
Easier is(without swapping): def permut(str,k): if len(str)==0: print(k) else: for i in range(len(str)): permut(str[i+1:]+str[:i],k+str[i])
@markovujanic Жыл бұрын
wow, this is very well explained, especially I liked how you wrote on branches swapping you do. Thanks a lot
@urvashisharma74153 жыл бұрын
interview in 20mins...thank god i watched this
@techdose4u3 жыл бұрын
You got it!!
@urvashisharma74153 жыл бұрын
@@techdose4u thank u so much for the reply 😭
@urvashisharma74153 жыл бұрын
@@techdose4u Update: I got placed 😭
@mallikarjunpidaparthi4 жыл бұрын
Wow... Clear explanation thanks brother : )
@techdose4u4 жыл бұрын
Welcome
@lucasbollella8487 Жыл бұрын
Thanks man, this video is really clear.
@techdose4u Жыл бұрын
Glad it helped!
@VishalKumar-pk9ek4 жыл бұрын
bahoot sahi explanation bhai😍😍😍😍
@techdose4u4 жыл бұрын
Thanks :)
@OP-yw3ws Жыл бұрын
This explaination is so easy to understand, thankyou!
@uttarandas81133 жыл бұрын
1:15 what you need to understand!!! Thanx sir! I don't know why was this video not on top of suggestions =(
@ChandraShekhar-by3cd4 жыл бұрын
The visualization technique is quite helpful in understanding the algorithms .. Thanks a lot TECH DOSE :)
@techdose4u4 жыл бұрын
Thanks
@harshpanwar15503 жыл бұрын
Beautifully Explained Sir...Thanks a lot!!!
@rakshitsingh75044 жыл бұрын
Thank you for explaining it, best of all I have seen.
@techdose4u4 жыл бұрын
Welcome :)
@b_rza2 жыл бұрын
Great explanation. Thank you very much
@techdose4u2 жыл бұрын
Welcome 😁
@idontusecryptocurrency58703 жыл бұрын
Thanks sir.Your video was very good for a beginner
@techdose4u3 жыл бұрын
Great ❤️
@TOMGAMING-hy9hi4 жыл бұрын
Comment to banta hai boss for your explanation.....
@techdose4u4 жыл бұрын
Thanks
@kanhashukla62654 жыл бұрын
Thanks for the efforts man. This helps a lot. Keep up the good work.
@techdose4u4 жыл бұрын
Welcome :)
@tanusrisaha48734 жыл бұрын
Finally understood recursive tree...awesome explanation..going to watch ur full playlist :)
@techdose4u4 жыл бұрын
Thanks :)
@kartikenbarnwal3 жыл бұрын
😍thak gya hu vro iski video like kr krke
@techdose4u3 жыл бұрын
:)
@priyanshuchaurasiya61842 жыл бұрын
Thanks a lot♥♥ , your explanation is so good the just looking at your pseudo code I am able to code the problem.😊😊
@mr-engin3er2 жыл бұрын
Good explanation. Thanks for sharing. Keep it up. All the best for your future.
@jimmy-dk9lo4 жыл бұрын
My mind is exhausted, but still I am able to understand, thanks a lot.
@techdose4u4 жыл бұрын
Welcome :)
@mohdshahzaib40943 күн бұрын
Thanks, Very good explanation sir.
@techdose4u3 күн бұрын
welcome
@justanotherlearner14043 жыл бұрын
bhai bahut easily explain karte ho ......thank you so much
@techdose4u3 жыл бұрын
Welcome
@jaskiranmalhotra9893 жыл бұрын
This is actually the best explaination thnx alot sir.
@shailendrakk62263 жыл бұрын
Awesome explanation.Loved it
@techdose4u3 жыл бұрын
Thanks :)
@adityaojha27014 жыл бұрын
Thanks a lot sir. You explained very well!!
@techdose4u4 жыл бұрын
Welcome ☺️
@suryakangeyan97513 жыл бұрын
just found this gem :) , subscribed !
@techdose4u3 жыл бұрын
Thanks :)
@kushalappaca53243 жыл бұрын
Excellent explanation! Great work👌👌
@techdose4u3 жыл бұрын
Thanks
@kushalappaca53243 жыл бұрын
@@techdose4u I have one doubt though.... Why do we need the second swap function? It works without that too... Recursion works that way right?
@jugsma66764 жыл бұрын
This is so much clear explanation indeed.
@techdose4u4 жыл бұрын
Thanks
@theerans7232 жыл бұрын
Very helpful brother. 🤞🏻Thanks
@vengateshwarang10 ай бұрын
Awesome, thanks for the good explanation
@debanjanpradhan76332 жыл бұрын
Great Explanation, Thanks a lot!
@techdose4u2 жыл бұрын
Welcome :)
@algotorials814 жыл бұрын
swap(a+l,a+i); permute(str,l+1,r); if [l=0, i=0 A-A swaps] , [ l=1, i=1 B-B swaps] , [l=3, i=3 and so C-C] should swap ? at 2:31 as l changes on each recursive call so do i. How is it getting swapped i cannot catch ?
@Ashok-oe3lo5 жыл бұрын
really a great explanation and its easy to understand...thanks for all your time. It will be helpful if you can also explain how to handle if the character is duplicate. Thanks
@techdose4u5 жыл бұрын
Yea you are ryt. This doesn't handle duplicate characters. I will try to make this case in future.
@bowenyi-kj3vr Жыл бұрын
This is a great explanation!!!!!!
@nagalakshmichithambaranath11474 жыл бұрын
The best explanation.
@techdose4u4 жыл бұрын
Thanks :)
@myyoutubeisthis Жыл бұрын
thank you very much sir for this explanation
@ITEngineer995 жыл бұрын
Excellent bro...keep uploading..I like your teaching..and great content....:)
@techdose4u5 жыл бұрын
Thanks :)
@eugeneyap42082 жыл бұрын
Love the explanation, I have a better visualization now.
@ibknl19862 жыл бұрын
Thanks
@harryhenderson3636 Жыл бұрын
Inspired by Wikipedia I have developed my own method of generating permutations which is similar to this - they might actually be the same thing. Here's how mine works. Suppose we have ABCD - the situation would look like this: 1 ABCD Now repeatedly copy line 1 and move B to the left until it can't move anymore. So we have: 1 ABCD 2 BACD Now we move on to C. Now we have to copy both lines 1 and 2 and move C. 1 ABCD 2 BACD copy of line 1 moving B 3 ACBD copy of line 1 moving C 4 CABD copy of line 1 moving C Now that C is all the way to the left we start copying line 2. 5 BCAD copy of line 2 moving C 6 CBAD copy of line 2 moving C C is all the way to the left again but now we have to change characters or we will get duplicate permutations. Whenever we change a character we start copying line 1 again. If you study the permutation list numbers you will notice the character changes take place based on the factorial numbers: 1!, 2!, 3! = 1, 2 and 6. Starting on line 2 we begin moving B, on line 3 we start moving C and on line 7 we start moving D. Subtracting 1 from these numbers gives us 1, 2 and 6. Here is my example extended to make sure the pattern is clear. 1 ABCD 2 BACD copy of line 1 moving B 3 ACBD copy of line 1 moving C 4 CABD copy of line 1 moving C Now that C is all the way to the left we start copying line 2. 5 BCAD copy of line 2 moving C 6 CBAD copy of line 2 moving C 7 ABDC copy of line 1 moving D 8 ADBC copy of line 1 moving D and so on...
@pawanlok17762 жыл бұрын
thank you , this video help me a lot to understand the topicc
@Sejal-Maheshwari-20024 жыл бұрын
Very well explained. Thank you !
@techdose4u4 жыл бұрын
Welcome
@hacker31910004 жыл бұрын
dude amazing video man, now i understand the recursion tree also, i thought your channel's name was TECH DOSA initially lol
@techdose4u4 жыл бұрын
Shit 🤣
@shubhampandey71773 жыл бұрын
good explanation. It really helped!!!
@techdose4u3 жыл бұрын
Welcome :)
@LegitGamer23454 жыл бұрын
FINALLY UNDERSTOOD!!!!!!
@techdose4u4 жыл бұрын
Nice :)
@atulkumar-bb7vi5 жыл бұрын
Wow! I found this explanation very helpful and simple to understand. Thanks for this!
@techdose4u5 жыл бұрын
Welcome :)
@glazeds0n4 жыл бұрын
very good explanation,,, as always
@techdose4u4 жыл бұрын
Thanks
@khakr015 жыл бұрын
Superb! Keep teaching
@techdose4u5 жыл бұрын
Thanks :)
@seetharaman66032 жыл бұрын
You are great. Nice and thank-you
@vinit__rai5 жыл бұрын
keep posting more videos....we all are support u...
@techdose4u5 жыл бұрын
Thanks :)
@ganeshjaggineni4097Ай бұрын
NICE SUPER EXCELLENT MOTIVATED
@techdose4uАй бұрын
Great :)
@debashisdas65932 жыл бұрын
very good explanation !!
@ququ96092 ай бұрын
It is amazing video for beginner
@techdose4u2 ай бұрын
Nice :)
@amrmoneer58813 жыл бұрын
this is a beautiful video. bless ur indian voice mate :D
@techdose4u3 жыл бұрын
Thanks :)
@amanrana15533 жыл бұрын
Nice explanation bro keep it up👍
@kunjanshah_sr4 жыл бұрын
public class Permutations extends Activity { String TAG = Permutations.class.getSimpleName(); char[] Res; int[] A; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); String input="ABC"; Res = new char[input.length()]; A = new int[input.length()]; perm("ABC".toCharArray(), 0); } void perm(char[] str, int k) { if (str.length == k) { Log.d(TAG, Arrays.toString(Res)); } else { for (int i = 0; i