Next Permutation - Intuition in Detail 🔥 | Brute to Optimal
Vložit
- čas přidán 22. 03. 2023
- Problem Link: bit.ly/3WOGkjH
Notes/C++/Java/Python codes: takeuforward.org/data-structu...
We have solved the problem, and we have gone from brute force and ended with the most optimal solution. Every approach's code has been written in the video itself. Also, we have covered the algorithm with intuition.
Full Course: bit.ly/tufA2ZYt
You can follow me across social media, all my handles are below:
Linkedin/Instagram/Telegram: linktr.ee/takeUforward
Please watch our new video on the same topic: czcams.com/video/JDOXKqF60RQ/video.html
this is the same video??
areee
thanks for the vid😄😄😄😄
Let's march ahead, and create an unmatchable DSA course! ❤
Use the problem links in the description.
Thanks bhaiya, great explaination.
I was waiting for this video I know you are busy but please try to upload alternate days....
** Timestamps **
0:42 Explaination of what problem says
3:26 Brutforce approach
6:45 Better approach
7:22 Optimal approach
24:58 Code
@@leoved1073 I was not doing well, the body took a toll.
Great explanation ❤️
Brute -> 3:25
Optimal -> 7:35 obj2: 16:14 logic summary: 18:57 algo 19:31
your're time saver thanks bro
Your intuition approach is so good that I'm afraid can not find anywhere on the internet, some programming education nowadays is kind of distorted by just do it for trend and profit. High quality and dedicated contents are so underrated in my opinion. Again thanks a billion for your great work and dedication! Understood!
Truly, humans like you are so much talented and generous to share their knowledge.
And AGI won't be this generous 🔥
I have been on your page for the past couple of days. Thanks for all you do we miss you
Understood very well. This is the ultimate sheet everyone needs!! Thank you for making such kinda premium content for absolutely free🤩🤩🤩
I appreciate your hard work, thanks for making these valuable videos for free.
Understood. Thank you so much for your dedication strive it is very inspiring, I am solving this at 12:02 on a sunday night because I have seen how hard you work to produce these videos, Thanks a lot.
Understood. A very good lecture tbh, the way you walked us through the approach, just loved and enjoyed it. Thanks Striver
The best explanation I could have ever asked for. Thank you, Sir.
Just in case ur confused,
//find the first adacent pair from right side where left is smaller than right
//if you dont find such a pair, reverse the whole array
//swap the left element in the pair with the smallest element greater than that to its right
//then reverse the sub array from the point of swap(after the left element in the pair) till the end
Very good understanding, but in last point you should edit reverse to sort. Because you should sort the sub array from the point of swap(after the left element in the pair) till the end and not reverse from that point. Cause you need the smallest value from those numbers. Not something random by revrseing them.
@@shekharsharma3331 no need of sorting because after swapping also this part of the array is still sorted. No point of sorting it again
Understood! Wow!! Super amazing explanation as always, thank you very very much for your effort!!!
a channel which can be subscribed without any hesitation or doubt. loving the depth of explanation ❤
Your explanation was excellent 👍👍👍🙏🙏🙏 but what I find more impressive is you can do this at 3am in the morning 👍👍👍👍
He doesn't live in india it might be 10 pm for him
Hats down the best video on this topic on the entire internet, was never able to understand this problem but after watching this video everything became so easy.
Understood!! Nicely explained Striver!! Thank you so much 😊
waited for this question's intuition video thank you striver for doing this.
Wow, hats off! This is one of the best explanations, that got through my head. Thanks man.
What a great explanation! Crystal clear!❤
Man Your teaching is fantastic even after buying a course for dsa i wasn't able to understand concept this better that you are providing free. Such A Gem Teacher....!
Best explaination of this question in coding community.No one can explain intitution as striver can explain . striver you are legend.
Have been waiting for ur video for the past 3 days
Very well explained the intuition and how the algorithm works, thank you for your great efforts.
The question was quite complex, but you made it easy, Thank you!
Hey!! Thank you so much for your awesome explanations . I really understood the intuiton and the problem was awesome too .. Waiting for your further lectures !!
At first, it was difficult to understand but after watching it again, it is crystal clear
Damn, dude, that explanation was just simply on some next level.
Absolutely amazing explanation of the intuition
This guy is a legend
Truly admirable! Your dedication level is worth emulating.
Understoooood 😃.
Learning DSA from u is so easy and fun
Hats off to you striver
Feel a gaya concept smajh kar... best explanation thank you bhaiya
very well explained I just loved it
Highly influenced by the intuition and the way he taught in the lecture😘
Great content with complete explanation, You explain the algorithm from basics
WOW! What an explanation! Genius.
What a wonderful explanation, thank you so much for explaining everything from one corner to another. ❤
Superb explaination !! Speciality of striver bhaiya is that he focus more on the intution than algorithm. Thanks bhaiya
LIiterally the observation you tried to explain is superb and code it my own once observation is clear cut anyone can code it by its own if he know programming language.
Understood...Thank You So Much for this wonderful video......🙏🙏🙏
Understood Bro! Heartful Thanks for you!
Understood 👍Thank you so much Striver !☺
Great explanation of the intuition, Understood 🔥
Understood bhaiya. Hats off to your dedication.
Really thankful and appreciate ur effort striver thanks a million! 👏
absolutely brilliant !
Very nicely done Striver !!!
Understoood....This video was much awaited..
i was not getiing the problem but now just one thing, u r just awesome
That's really fantastic. Amazing 🔥🔥Thankyou Striver. Leetcode problem is done by myself.
What a explanation skill you have bro.
Thanks for quality content .
understood, extremely good explanation!
Concept is superb explain...I pause the video in middle of it press the like button and then continue..👍
Appreciate your hard work!
This is one of the best Logic I came across
nicely explained...thankyou for such an elaborate explanation!
What an explaination, loved the way Striver explains
Thanks a lot, brother. Love and Respect from Bangladesh
One of the best explained solution. Thanks for the content
I am beginner at DSA and I have gone through the same problem of yours from Array series 2-3 times but intuition was not being clear. But this video has cleared in first few minutes. Thank you so much.
This A2Z DSA course is world's best course. You have made one the complex topic in IT industry very easy for the world.😍
Did you finish this A2Z DSA Series..?
understood , this is the best channel ever.
Had to go over it twice but understood it now!
Kya hi samjhaya hai bhai. Killed it.
Thank you for making it super easy to understand!
Understood everything literally amazing explanation bhai :)
Excellent intuition building teaching... Salute to the hard work.🧑💻
amazing explanation , you nailed it.
Hey Striver, the explanation is amazing. Thank you so so so much!!
I wonder how you come up with these ways to explain 😅
Your videos are just amazing and helpful
Thanks a lot for an awesome course
God bless you
Best Explanation Ever.. Thank You So Much for all the Efforts. 🍀❤🔥🔥
Thanks for sharing the intuition. It's really helpful.
the god of explaining complex algos..🙏🙏🙏
Great Course Thanks Striver Bhaiya
Amazing Explanation ❤
just awesome...mja aa gya 🥳🥳
Amazing Explanation!!🔥🔥🔥
Understood very well !!
Amazing work. Thanks.
by the way your explanation is truly amazing..!!!
This was explained very beautifully. Thanks striver
amazing explanation . the way you explained it is phenomenal.
Very well explained. Thank you.
Very very easy to understand.
Great explanation.
Thanks a lot.
He is made for this ...
Striver!! Truly you are made to teach DSAlgos!!!!
Hats off ❤
Are you also studying DSA from this section of the video? If you are, would you be interested in learning together? Please let me know if you're open to learning together.
You are just amazing Striver😌
Great video, thanks for it
I was sure that it was the best channel for DSA 100%
BEST EXPLANATION mjja aa gya 🔥
awesome teaching.Thank you very much.
I have always tried to avoid this question because I was unable to digest its solution, but I will recommend all the new users to please watch the solution till end, you will get to know why Striver is the God of coding world.
Wonderful channel , wonderful content...
To all my fellow learners : Bus yahan se padhlo naukari pakki hai tumhari!! Naukri hai toh promotion pakka!!!
Thank you v. much Striver
avoid this question so do you mean that you try and solve the qsns before watching tutorials? is that the right approach?
@@savage4493 No, because I was not able to grasp the knowledge, I just used that Stl library to solve this, but now I'm confident enough to write its logic.
Can you explain the logic of the code
21:32
@@harsha4048 first you are looping from backward and checking condition a[ i ] < a[ i+1 ] (so here is dry run a[ i ] < a[i+1] == a[ 4 ] < a[5 ] hear 4 and 5 are index which means a[ 4 ] = 3 and a[5 ] = 0 that means 3 < 0 ( hear its not meet the if condition so it wont go inside the if block ) it will satisfy the if condition only at index 1 { a[1] = 1 and a[i +1 ] = 5} , i hope you get it..
wow seeing all the comments i am very glad i got stuck in this problem and gave 2 days of time to think solution of this problem on my own on free time while also solving other problems, and got the exact approach on my own lol idk how @@pragatisrivastava8051
wow. amazing explanation dada. understood
love your tutorials man hats off
understood bro.. thanks for your efforts
@striver, you are a God in DSA. I Salute you bro!!! Thanks for all you do for us
Great intuition!
striver bhaiya .. uh are great thanks for giving us this lecture
Thank you striver for explaining this hard problem
Amazing video, subscribed. :)
Thank you so much bhaiya, ekdum samajh aagaya