Apart from your clear explanations and illustrations, I love your candid commentary. It makes me feel a lot better when encountering mediums that take the whole day to understand and am questioning my sanity.
I got asked this in an interview once. Luckily had it memorized and sounded confident enough in my delivery that the interviewer didn't question whether I understood why the algorithm would work 🤣
This video is so much easier to follow than the others. I hate this problem too (which is why I’m here), but this seems intuitive and I guess we don’t have much of a choice when interviewing 😂. Great video!
I've watched so many of your videos and every single one I have seen has been a literal god send. The problem sucks ass but, you make it suck way less. Appreciate your hard work.
I am strugggling with this problem and starting to think I am stupid. I try again and again but can not find a proper solution until I see your video. I will continue to exercise again and try to learn the way to problem-solving. I dont want the solution only but the thinking to the solution also. Thanks so much.
I noticed an interesting edge case that may not have been discussed in the video. The algorithm I came up with was very similar to the solution in the video, but instead of my while condition being nums[swap]
Excellent solution and explaination ! but having trouble with understanding how you decremented swap but till the last element got swapped with the pivot element ....
Excellent explanation actually and the code is efficient. Only issue I have is with the else statement after a for loop. I simply used "if pivot == None: nums.reverse()". Otherwise this is the best explanation of the problem out there!!
that else statement is so cursed LOL. I had absolutely no clue you could do that! I wonder if doing that in an interview would bother some interviewers? :)
you don't like the problem, but anyway liked it :D Thanks for the video! my brain hurts, but it does for most of the problems, I consider this pain as a study process (hope it's not a tumor :D )
Haha there’s some questions you learn to understand the topic, and there’s some you learn because you have to. This is definitely one you just memorize, it’s horrible
This was a great walk through of the algorithm. For those who are looking for a break down of the intuition of the algorithm (or just want to understand how permutations works), This video does a great job th-cam.com/video/quAS1iydq7U/w-d-xo.html
This was honestly a pretty bad explanation. The classic "I think it makes more sense if we look at the code" is such a cop out for not just preparing a few more clear examples and actually walking through them. Your usual videos are much better quality tbh. This one just feels like you kinda gave up and were like we just have to follow this formula which you have no idea how it was derived.
Great I'll await your video on the topic and make sure to leave you a thumbs up and a subscription for explaining it better than I can. It's just one of those questions that's beyond stupid. Not every video is going to be perfect, some questions really are just shit and your best beet is to memorize the solution and make do the best you can. Just the nature of the game
Apart from your clear explanations and illustrations, I love your candid commentary. It makes me feel a lot better when encountering mediums that take the whole day to understand and am questioning my sanity.
I got asked this in an interview once. Luckily had it memorized and sounded confident enough in my delivery that the interviewer didn't question whether I understood why the algorithm would work 🤣
The casual "Fuck" at 6:53 is gold LMAO
Yea it's one of those problems lol
I like that part as well.
This video is so much easier to follow than the others. I hate this problem too (which is why I’m here), but this seems intuitive and I guess we don’t have much of a choice when interviewing 😂. Great video!
15 seconds in and I realize I am not alone when it is about hating this problem
It became my favorite problem in LeetCode series so far because of you made it crystal clear!
Haha you might be the first person to ever say Next Permutation is their favorite Leetcode problem
Thank you for the honesty at the beginning, I thought I was the only one who had no intuition for this problem lol
I've watched so many of your videos and every single one I have seen has been a literal god send. The problem sucks ass but, you make it suck way less. Appreciate your hard work.
First time to know that we can add an "else" for the for loop :D, Thanks for the explanation though!
Yea it's definitely something I learned during Leetcode as well I had no idea lol
I am strugggling with this problem and starting to think I am stupid. I try again and again but can not find a proper solution until I see your video. I will continue to exercise again and try to learn the way to problem-solving. I dont want the solution only but the thinking to the solution also. Thanks so much.
I noticed an interesting edge case that may not have been discussed in the video. The algorithm I came up with was very similar to the solution in the video, but instead of my while condition being nums[swap]
Best Description Ever by Cracking FAANG: This is #1 BS
Thank god for Leetcode! They ask bullshit questions, I memorise the code from the solutions tab 😂
Your explanation isn't as terrible as you made it out to be lol ngl I nearly skipped this one but chose to give it a shot anyways. Thanks for the vid!
Thank you so much for making this video!! I hate this problem too but your explanation made me hate it a lil less :)
Excellent solution and explaination ! but having trouble with understanding how you decremented swap but till the last element got swapped with the pivot element ....
Excellent explanation actually and the code is efficient. Only issue I have is with the else statement after a for loop. I simply used "if pivot == None: nums.reverse()". Otherwise this is the best explanation of the problem out there!!
It’s a Python thing. You can include an else statement at the end of a for loop which will run if no return/break is hit by the time the loop ends
@@crackfaang okay got it!
that else statement is so cursed LOL. I had absolutely no clue you could do that! I wonder if doing that in an interview would bother some interviewers? :)
Thanks, this was the best explanation, but seriously how is one supposed to figure this on a whiteboard lol 🤣
thanks for the clear explanation, one question, does splicing use extra memory?
could you please make explanation on 1611. Minimum One Bit Operations to Make Integers Zero too? i still didnt understand that problem
9:31
[1, 4, |5|, 8, 7].
"you swap it to the first largest number to the right of the pivot that's greater than 5"
*chooses 7* ???
This is a really good explanation! Early yourself a sub :))
you don't like the problem, but anyway liked it :D Thanks for the video! my brain hurts, but it does for most of the problems, I consider this pain as a study process (hope it's not a tumor :D )
Haha there’s some questions you learn to understand the topic, and there’s some you learn because you have to. This is definitely one you just memorize, it’s horrible
In love with the comments :-)
reversed(nums) in Python uses O(n) space, not O(1). It creates a new list.
The video is over 2 years old. They must have changed the problem to ask for it in place. This was the old official solution
People with 199 IQ: Damn it :(
This was a great walk through of the algorithm. For those who are looking for a break down of the intuition of the algorithm (or just want to understand how permutations works), This video does a great job th-cam.com/video/quAS1iydq7U/w-d-xo.html
6:54
😂
thanks
This was honestly a pretty bad explanation. The classic "I think it makes more sense if we look at the code" is such a cop out for not just preparing a few more clear examples and actually walking through them.
Your usual videos are much better quality tbh. This one just feels like you kinda gave up and were like we just have to follow this formula which you have no idea how it was derived.
Great I'll await your video on the topic and make sure to leave you a thumbs up and a subscription for explaining it better than I can. It's just one of those questions that's beyond stupid. Not every video is going to be perfect, some questions really are just shit and your best beet is to memorize the solution and make do the best you can. Just the nature of the game
@@crackfaang fair enough, at least you acknowledge it isn't the best video. you're def right this game is very dumb
Could you also pls make a video on 1268. Search Suggestions System? I'd really appreciate it. Thanks!
Sure thing! I don’t have any videos on Tries on my channel so should be a good video to make
Thanks