Комментарии:
Damn, I was so close to the answer. I just couldn't write the whole thing in any correct order. I had the base case, I knew I needed a loop somewhere with perm[:i] + char + perm[i:] and I knew I needed the function to call itself but I just could'nt put it all together >< so frustrating. Your solution makes perfect sense but I don't know if I could ever get that to all come out of my head the correct way. It seems so complicated, building a list, doing the permutations, going through the list to add more complex permutations...
Ответитьbest video explanation of recursion, bro deserves a W👍
Ответитьgive me a code pls
Ответитьdont know why i can solve really large and complex problems but when it comes to recursion, no matter the complexity, my brain just freezes LoL
Ответитьthis is fucking great, thx
ОтветитьThis is a nice solution for a few letters but what would be a better algorithm than this? obviously it cant find permutations for let's say 12 characters.
ОтветитьDude, I seriously cannot thank you enough for this video. I was struggling with the idea of recursion and you filled in the gaps in my knowledge. Thanks a million
ОтветитьTnank you! It was very helpful explanation how it works
ОтветитьI'm getting this instead;
['ca', 'cac', 'cacb', 'ca', 'cac', 'cacb', 'cacbc']
Thank you for this. Very helpful! A quick question, when you got result=['bc', 'cb'], then why perms become ['bc', 'cb']?
ОтветитьThis video deserves more views! You nailed it!!!
ОтветитьYou are an absolute chad
ОтветитьThank you so much!!!
ОтветитьCan someone please help me with time and space complexities here?
ОтветитьThank you so much for this video!
ОтветитьYour explanation was the best! Thank you so much. I haave been stuck on this for so long.
ОтветитьThank you 8^)
ОтветитьThanks for this video - great explanation!
One request - can you please add time and space complexity to this video?
This is best available code and explaination i guess
ОтветитьTrust me man you just nailed this i was trying for long to get being from non-Cs background it was difficult to digest but hats off to you
ОтветитьIf I don`t find the result by my own, should I quit programming learning?
ОтветитьNice video, but for the second iteration, why did you use the range function and added +1
ОтветитьYour solution rocks my friend
... returns love from India...
thanks for this video,the explanation is amazing!
ОтветитьPerfect explaination, you sit, take a bow
ОтветитьVery well Explained 🔥🔥
Ответитьwhat should we change
Ответитьcan you do with repetition of the char
Ответитьthanks a lot man
ОтветитьYou r amazing sir thank you very much
Ответитьit doesnt word anymore i dont know why here is my code:
ОтветитьWhat coding program is this and where do I download it?
ОтветитьSaw you in that Rabbit getting scared by its own fart.......
Now your subscriber
Peace be upon you. Can you add the Arabic translation to your videos please🙃🌹
Ответитьdoes it also cover cases like: aabc ? wont there be like twice as much permutations than there should be ?
ОтветитьDude thank you for that simple explanation "2nd function call, first recursive call." I have been trying to wrap my mind around how code like this works but you really simplified it
Ответитьhow do I do it if i want every permutation of a specific length? If my string is ABCS but only wants the permutations of length 3?
ОтветитьHi Wrt Tech I'm new in python and my cousin looking for the solution
on this kind of assignment. you might solve this. Please help.
I'm trying your video tutorial on this matter.
PERMUTATION OF LIST OF STRINGS
Given a list of strings such as arr = ["abc", "de", "fgh"], cycle through/print all the combinations starting from the first word to the last. Implement the recursive function as f(index) and implement a global variable called build for your solution. You may also use global variables to track the number of strings in the list, and the list of strings itself. Input Format
The first line of the input contains n, the number of strings to read The next n lines contains strings composed of small-case alphabetical characters only
Constraints
1 <= n <= 6 1 <= length_of_each_string <= 6 Output Format
permutation1 permutation2 ... permutationK
How should I write the code if the inputs and outputs look like this.
Sample Input 0
3
abc
de fgh
Sample Output 0
adf
adg
adh
aef
aeg
aeh
bdf
bdg
bdh
You made the rock edible for me
ОтветитьThank a lot, especially for visualizing the execution of the code. It made me fully understand the solution. I have struggled with permutations and have seen a couple of other explanations/solutions, but yours is the only one that walked through the execution in detail and thus made me really understand the code.
ОтветитьThanks for the video. I've been racking my brain on this for a few days because i was under the impression that the return needed to be the function call...
My brain kept coming back to having the recursive call go into a variable, but thought it wasn't allowed in a recursive function. Turns out i failed because i was too strict about what i thought the "rules" were... lol
Here's an updoot and a sub :P
Thanks a lot
Ответитьi struggled so much to understand permutation and this video is so far the best. detailed explanation! awesome and thank you so much
ОтветитьKeep going! :) please don't stop.
ОтветитьThanks you sooooo soooo much. I was wondering how to do that... I first start looking for patterns. Like for example, using numpy.... with word 'cold'... which is a 4 letter's word... so it means 24 posibble permutations... then i divided by lenght of the word (4) and got that every letter would have to be on the first posittion 6 times... so it would be something like below.... and then repeating thesame for each colum... but it needs to use conditionals to don't take the letter that was in the first column to aviod repetitions.... so i decide to look for something more simple and the answer was tooo much simple but not for me easy to understand it... Thanks you sooo mch ♥♥♥
c x x x
c x x x
c x x x
c x x x
c x x x
c x x x
o x x x
o x x x
o x x x
o x x x
o x x x
o x x x
l x x x
l x x x
l x x x
l x x x
l x x x
l x x x
d x x x
d x x x
d x x x
d x x x
d x x x
d x x x
this solution deserves a like ..best explanation
ОтветитьCan a recursive funtion use a for loop? I thought recursion was used instead of a for or while loop.( sorry if this is a dumb question, i'm new to this lol.)
Ответить