Table of Contents: Introduction: Discussing The Past 0:00 - 0:33 Talking About The Implications Of Today's Video 0:33 - 1:08 The Problem Introduction 1:08 - 3:00 The 3 Keys To Backtracking (As Always) 3:00 - 5:01 Tracing The Recursion Tree: Watch The States 5:01 - 10:16 Time Complexity 10:16 - 10:48 Space Complexity 10:48 - 11:19 Subscribe To Us Plz 11:19 - 11:41 The code is in the description. Fully commented for teaching purposes and understanding.
@faizannasimhyder90113 жыл бұрын
Where is the code in the description?
@user-gz7fh8vo6e5 жыл бұрын
What you said in the beginning resonated a lot with my experiences. Most videos out there explaining these solutions don't dive into the intuition behind making certain logical leaps for coming up with the solution, which is probably the crux of the difficulty. Keep up the great work.
@BackToBackSWE5 жыл бұрын
thanks, hey
@mohammedshahraazhussain17595 жыл бұрын
When he speaks, It feels like he is about to get inside my brain.
@BackToBackSWE5 жыл бұрын
hahahahahahahaha, ok
@夏天-y3j5 жыл бұрын
Your voice is 66666 in chineses.
@BackToBackSWE5 жыл бұрын
@@夏天-y3j what
@gaoyukuan4 жыл бұрын
@@BackToBackSWE "Six" pronounces the same as "溜", which means smooth or something is going really smoothly. It's often used as a compliment to say somebody or something is great (with the "smooth" feeling haha). Also, 5 * 6 means 5 times smooth.
@joon-tech4 жыл бұрын
this just made my day hahah
@theFifthMountain1235 жыл бұрын
You are an awesome teacher. Please keep making these videos.
@BackToBackSWE5 жыл бұрын
Thanks. That means a lot. And I will. As long as I can maintain my energy levels high this is my dedication.
@13282374 жыл бұрын
Dude, I seriously cannot believe how much I struggled with this problem until I saw your thinking behind it. I typed up a solution in less than 5 mins. You are seriously a beast. Bless your soul man.
@hackytech74943 жыл бұрын
You are the best teacher on entire KZbin platform. No one have explained any problem in such an expressive way [ The way you teach ]. Thanks for your tutorials. Please don't stop teaching.
@sean7218884 жыл бұрын
“This is the understanding I want you to understand!” Such a awesome video
@BackToBackSWE4 жыл бұрын
thanks - vintage video...from the origin days
@redherring274 жыл бұрын
0:08 Another day another boring question to cover. 1:08 Aoolrite so today we have a fascinating question.
@BackToBackSWE4 жыл бұрын
hahahaha sorry older video so I was goofier, no one was watching
@vishwajeetmanhas_5864 Жыл бұрын
Your ability to completely explaining crux of problem is amazing.
@hernabaer4 жыл бұрын
I can't believe how easily I understood the solution after I watched your video. I can't believe how easily I've written the actual code without looking any example code but only watching your video. Thank you so much!
@BackToBackSWE4 жыл бұрын
great & sure
@mirceskiandrej2 жыл бұрын
Hated this problem but this is the best explanation on KZbin about how to solve it. Thank you.
@BackToBackSWE2 жыл бұрын
Glad to be able to help. You should try our 5 day free mini course for some awesome content - backtobackswe.com/
@ChideraAbaraonye6 күн бұрын
You're the best teacher ever, and I'm being VERY honest. You have helped me understand concepts I used to struggle with
@SR-we1vl4 жыл бұрын
I guess this is the BEST CHANNEL FOR SOFTWARE INTERVIEWS!
@BackToBackSWE4 жыл бұрын
YES
@fudgemelons5 жыл бұрын
Thanks! Struggled on this problem for a bit, but after 5 minutes of the video I was able to come up with the right answer.
@BackToBackSWE5 жыл бұрын
AWESOME! Go get em'
@cool2suck5 жыл бұрын
I've watched countless algorithm explanation videos.. yours are by far my favorite!! I can actually understand the how & why to the approach instead of just learning this is what you do. Thank youuu
@BackToBackSWE5 жыл бұрын
Sure, tis' no problem
@waliiut085 жыл бұрын
Every time I get stuck in a tough problem like that or cannot think to code properly (most of the time it is so depressing), I just see your explanation for that problem. After seeing your explanation I really feel that I have to think the way you think to solve any problem. Your videos help me to understand the problem and to get the motivation to think deep like a true engineer. Please keep up your good works. Best of luck and thanks a lot.
@BackToBackSWE5 жыл бұрын
Nice! thanks, all this interviewing stuff doesn't really map to real engineering but it is an exercise in thought
@coconutjuice77777774 жыл бұрын
Thanks. Understood the solution literally within 2 mins (I had spent a decent amount of time on this before).
@BackToBackSWE4 жыл бұрын
great
@sridharchaitanyagudur74623 жыл бұрын
You have no idea what you are doing to my brain, you are making my neurons communicate at light speed. Thanks a lot. !
@grantherman1971 Жыл бұрын
dude this is literally the type of explaination I have looked for. So many other videos just gave a soloution and didnt really explain wtf was happenig. You are wonderful
@BackToBackSWE Жыл бұрын
Really glad to help 🎉 Do you know about our 5-Day Free DSA Mini Course? Check it out here - backtobackswe.com/
@johnleonardo5 жыл бұрын
My favorite explanation yet. Very satisfying when I realized how easy this problem is.
@BackToBackSWE5 жыл бұрын
nice
@sidagarwal434 жыл бұрын
It's only because of your videos I have been able to improve my leetcode rank. Your videos are simple and informative, please dont stop this great work ever. Love from India.
@BackToBackSWE4 жыл бұрын
great and ok and wassup
@muthaiahpalaniappan80093 жыл бұрын
I can able to use this pattern for various problems. Thank you so much. Today I came across a staircase problem. I used the same idea and it worked. Thank you so much 😍 Golden words ***1. Options 2. Constraints 3. Goal***
@ekejma3 жыл бұрын
He is so relatable... if I had an instructor like him in school it would have been so much easier.
@juliolopezmontalvo4 жыл бұрын
I've seen a lot of explanations about this problem but this is so far the best explanations I've seen about using backtracking, thanks!
@BackToBackSWE4 жыл бұрын
great to hear and sure
@Theberner05 жыл бұрын
You know what man , you are the best teacher for backtracking out here .. keep up the good work mate ..
@BackToBackSWE5 жыл бұрын
thanks a lot
@mosesindecks5 жыл бұрын
I love your videos man. They are the greatest thing to have happened on KZbin since 30 Seconds to Mars.
@BackToBackSWE5 жыл бұрын
hahahahaha
@code_yoda19284 жыл бұрын
You are a gem of a person for making our lives easier.You are god sent really
@BackToBackSWE4 жыл бұрын
thanks
@phanichoragudi575 жыл бұрын
Best explanation i've seen till now. Keep rocking!
@BackToBackSWE5 жыл бұрын
thanks
@stark.aritra3 жыл бұрын
Keep making these videos brother, I looked at so many different people's explanations. But none explains so smoothly and deeply like yours. Keep up the good work, thanks.
@nsivaramprasad5 жыл бұрын
Greatly explaned !! Problem understanding is simplified and it is lot better than going through the code for understanding !!
@BackToBackSWE5 жыл бұрын
ye
@3darpan3 жыл бұрын
You have a whole other ability to make concepts clear. Thanks man!
@chiragkushwaha5465 жыл бұрын
Exactly no one has explained these problems like you do , nice work keep it up.
@BackToBackSWE5 жыл бұрын
ye, will do
@frankchen92645 жыл бұрын
You are really awesome! I used to think about this question about an hour but I have no idea about that. But after listening to your video, I began more clear about that.
@BackToBackSWE5 жыл бұрын
Yeah, I didn't solve this when I got it first.
@karthiklv292 жыл бұрын
You Sir are an amazing teacher, didnt even need to see the code, your explanation is gold.
@palashkamble23254 жыл бұрын
Dude, when you started with top down approach and said there can be two decisions to make at each node, I was like damn it is that easy to solve. Why couldn't I just come up with this approach? oh wait, I know, practice is all I need. Thanks btw :)
@BackToBackSWE4 жыл бұрын
great and thanks.
@kuralamuthankathirvelan5 жыл бұрын
No comments , Simply Awesome 👌.
@BackToBackSWE5 жыл бұрын
thanks
@katyasadovnycha66704 жыл бұрын
You cracked me up lol.. ''another day, another really boring question to cover'! Can't agree more :D
@BackToBackSWE4 жыл бұрын
my bad - old video I messed around more
@Endlessvoidsutidos5 жыл бұрын
love the vid btw i was recommended to this channel by friends who said it was the best channel for software engineer interview training videos killing the game son
@BackToBackSWE5 жыл бұрын
thx
@HarshaVardhan175 жыл бұрын
Hi Benyam Ephrem, Firstly the explanation is very clear and understandable even in such a short video. Second, I want to point out that there are atmost 2n stack frames and each stack frame stores a string which is of max length 2n. So Space complexity is O(2n*2n) i.e O(n^2) . Thanks!
@BackToBackSWE4 жыл бұрын
I haven't replied to this for a bit, replying to close this out in my "unresponded to comments" feed.
@ridhisood49515 жыл бұрын
I was so confused with the solution of this problem. But now finally understood the backtracked solution.. thanks for making this video..
@BackToBackSWE5 жыл бұрын
Nice! happy
@mohamedabdul6334 жыл бұрын
Wow you are genius man, I wish found this video before. I was depressed that I could not even solve this problem, this video helped me to break down the problem.
@BackToBackSWE4 жыл бұрын
nice, glad to hear
@flacco89855 жыл бұрын
Extremely well explained. I was able to code it myself after watching the video, thanks!
@BackToBackSWE5 жыл бұрын
NO WAY! THAT IS AWESOME!!! That was literally my mindset going into this video. Funny you said that. You see now? The key is knowing our choice. Once we know our choice we CONSTRAIN that choice. And then as long as we define our goal correctly we will catch all answers at the bottom of the recursion in the base cases. Thanks for commenting! This is great to hear and makes me happy as a teacher.
@stephenplautz46824 жыл бұрын
This video, and especially the 3 keys to backtracking problems were incredibly helpful for me. I have gotten so mich better at spotting and applying backtracking to problems by applying them 😄
@Kushagra_214 жыл бұрын
this is by far one of ur best video in recurssion problrms. Thanks a lotttt
@BackToBackSWE4 жыл бұрын
I agrre minus having no mic
@richardli95143 жыл бұрын
"How do I even solve this under pressure?"--my number 1 question all the time on leetcode
@seungjinkim88604 жыл бұрын
Thank you! Drawing out the recursion tree is key to understanding this problem for me.
@BackToBackSWE4 жыл бұрын
sure
@AllanPichardo4 жыл бұрын
Thank you so much for explaining this. Very intuitive. Also I'm glad the focus wasn't all on the code, more on the concept.
@BackToBackSWE4 жыл бұрын
sure and yeah
@yanxichen42365 жыл бұрын
Thank you for making these videos! You explain the concepts and your thought process very well. Please keep up the great work! Looking forward to learning more from you :)
@BackToBackSWE5 жыл бұрын
Thanks, and yeah...it is so tiring. I'm editing a video right now and I'm so tired. It's a lot of work.
@yanxichen42365 жыл бұрын
Back To Back SWE oh no... Well, I for one am glad you’re making more videos, but please do it at a sustainable pace! Burnout is no fun - I’ve no doubt your channel is going to be one of the biggest swe prep channels one day, but there’s no hurry in getting there! And thank you thank you for your hard work :)
@BackToBackSWE5 жыл бұрын
@@yanxichen4236 haha thanks
@jose.dances4 жыл бұрын
Haha, I love the intro. Thanks for everything you do, Ben. I have a harder time learning some of these concepts, so it's helpful to hear that there's other folks out there in similar boats.
@BackToBackSWE4 жыл бұрын
Old video, my bad for the intro - and great.
@fathimasifasyedmusthafa9410 Жыл бұрын
u are a great teacher , pls continue teaching. Ur voice first of all makes it interesting which every teacher needs.:) awesome !!
@TheAdityaVerma5 жыл бұрын
the best !! the best ever !! the best one can explain !!
@BackToBackSWE5 жыл бұрын
thanks
@TheAdityaVerma5 жыл бұрын
@@BackToBackSWE hey man, can you please make a video on "Minimum number of jumps to reach end". Its a DP problem. But it has a O(n) approach. I am not able to understand that approach.
Here is the link for it.Hoping you will consider my request !!
@BackToBackSWE5 жыл бұрын
@@TheAdityaVerma yeah I would if I had the time but right now too busy
@yujiawang81685 жыл бұрын
Amazing explanation! The clearest video on youtube I've seen to throughout this problem, thanks a lot!
@BackToBackSWE5 жыл бұрын
thx
@avoo1d4 жыл бұрын
My God, I just love this explanation, Thank you very very much, because of your explanation I do not have to see already written code and did it myself with recur.
@BackToBackSWE4 жыл бұрын
nice thanks
@poojachi5 жыл бұрын
Best explanation! looking forward for more videos!
@BackToBackSWE5 жыл бұрын
yep!
@fracturedude3 жыл бұрын
Really great job explaining. I was having a hard time figuring out the recursion. You made it clear!
@aanyaaryancoolgamers20135 жыл бұрын
Awesome explanation. You are making our lives so easy. Your channel gonna rock!!!!!!!!!!!!!!!!
@BackToBackSWE5 жыл бұрын
thanks. just trying.
@CodeSuccessChronicle3 жыл бұрын
It is indeed the best channel for s/w engineering students :D
@harini31915 жыл бұрын
U made these concepts very clear and your teaching method is really good ! thanks
@BackToBackSWE5 жыл бұрын
sure
@idundidit4 жыл бұрын
man... I finally understand this. Thanks so much for putting this explanation together.
@BackToBackSWE4 жыл бұрын
sure thanks for watching
@ferneutron2 жыл бұрын
Really good content! I've been struguling with Batctracking/Recursion and the way how you explain is super clear and understanable. Thanks a lot!
@BackToBackSWE2 жыл бұрын
glad to help!
@nazmussakib59835 жыл бұрын
Thank you so much for the clear explanation! coded it after watching only 6 minutes of the video...:)
@BackToBackSWE5 жыл бұрын
Excellent. Keep practicing. Keep getting better. Tell me of any offers you get one day! :)
@nazmussakib59835 жыл бұрын
@@BackToBackSWE of course. I will!
@BryanAndradeNYC5 жыл бұрын
I've watched a few of your videos. I like the way you explain CS concepts clearly. Subscribed and thank you for taking the time to make this.
@BackToBackSWE5 жыл бұрын
Sure, it is nothing. Just a part of my mission. I'd really appreciate it if you shared content you like or the channel on reddits like r/cscareerquestions. They keep denying me a post and I think these videos would help so many.
@shantanunair5 жыл бұрын
@@BackToBackSWE Wow sucks that they don't let you post. But I can see why. I'll try and spread the word on r/cscareerquestions and on hackernews.
@ElGalloUltimo5 жыл бұрын
You are damn right about there being no videos that explain it like you do. I think the way you do and you explain it the way I think. So thank you for doing these videos. The way you cut yourself off and end the videos abruptly cracks me up btw 😂
@BackToBackSWE5 жыл бұрын
Yeah I was geekin back in the day, the me that exists now is not the same as the 80 or so Ben's you see on your screen.
@mauricegoldberg74584 жыл бұрын
Extremely well explained. Really helped this problem finally click for me. Thank you very much!
@BackToBackSWE4 жыл бұрын
great.
@vinayak186f33 жыл бұрын
I could code it by myself , all thanks to you sir .
@evanbradley72984 жыл бұрын
Says he's not a teacher and then goes on to explain these concepts better than any professor I've ever had lmao
@BackToBackSWE4 жыл бұрын
ye
@wh2644 жыл бұрын
Super helpful, really help me grok the concept better without completely giving out the answer
@BackToBackSWE4 жыл бұрын
great
@chetanpatteparapu76003 жыл бұрын
Thanks for your great explanation. I always struggle with Cominbators topic.
@agnes92284 жыл бұрын
I got this question during my interview and totally got lost..... recursion kills me every time..... Thanks for the amazing explanation, I think I will be able to answer it next time :)
@nishadkumar73225 жыл бұрын
Finally, someone who did it right! Thanks @Benyam Ephrem.
@BackToBackSWE5 жыл бұрын
sure
@adityasoni12072 жыл бұрын
ou are an awesome teacher. Please keep making these videos. Thanks a lot!
@ANJANI49865 жыл бұрын
Played the video in 2X. What a great rap! Even better than Eminem. Thanks for the awesome video.
@BackToBackSWE5 жыл бұрын
what lol
@neesargmistry20713 жыл бұрын
bro, keep making me understand how you understand it because I understand it the best the way you understand it :)
@BackToBackSWE3 жыл бұрын
Thank you, I will
@shubhamagarwal29984 жыл бұрын
He speaks from soul
@BackToBackSWE4 жыл бұрын
lol - sure
@xyaayaayax5 жыл бұрын
i love how you just skip the time complexity altogether with a blunt reason lol. great video!
@BackToBackSWE5 жыл бұрын
not sure if this is bad or good but k
@ujjvalsharma50554 жыл бұрын
Hey man wonderful explanation there. One of the best on the internet. Keep it up : ). I hope you post more videos
@BackToBackSWE4 жыл бұрын
thanks
@annarzheutskaya53013 жыл бұрын
A very good explanation! Great job.Looking forward to new videos.
@BackToBackSWE3 жыл бұрын
Glad you liked it!
@rahul10anand14 жыл бұрын
Crystal clear, thanks, Ben!
@BackToBackSWE4 жыл бұрын
sure.
@tootsie405 жыл бұрын
You, sir should consider a career as a teacher full time. Jamazing
@BackToBackSWE5 жыл бұрын
Indeed I am pondering such a choice.
@prabhjyotsingh1395 жыл бұрын
It's already T H E Best channel !
@BackToBackSWE5 жыл бұрын
thx haha, we ain't there yet. Tens to hundreds of thousands of people need jobs
@prabhjyotsingh1395 жыл бұрын
@@BackToBackSWE keep up the good work Sir. So thankful for your time and effort.
@anuragkothare61814 жыл бұрын
Great Explanation. Crystal Clear.
@BackToBackSWE4 жыл бұрын
thanks.
@osamayounus48672 жыл бұрын
This explains everything so well. Thank you
@oludarevictor46114 жыл бұрын
Dude, you are amazing! I wish I found your channel before now
@BackToBackSWE4 жыл бұрын
No ur amazing
@karnifazil4 жыл бұрын
Awesome explanation! So nicely explained backtracking.
@BackToBackSWE4 жыл бұрын
thx
@xiuwenzhong73755 жыл бұрын
you are a good teacher, tbh, I give up most of videos speak in Chinese.
@BackToBackSWE5 жыл бұрын
haha
@davngo5 жыл бұрын
Thank you! This video helped me gain a better understanding of recursion.
@BackToBackSWE5 жыл бұрын
nice -Ben
@linnaqiao60764 жыл бұрын
Really great and clear explanation! Thanks!
@BackToBackSWE4 жыл бұрын
sure
@cryptojeff39933 жыл бұрын
Best Explanation for this problem!
@mausami16mau4 жыл бұрын
you made it very simple and easy to understand, thanks.
@BackToBackSWE4 жыл бұрын
thx
@praptitrivedi74495 жыл бұрын
Keep up the good work! Got the intuition quite well.
@BackToBackSWE5 жыл бұрын
good
@himaupadhyay92774 жыл бұрын
He is always at rescue !!
@BackToBackSWE4 жыл бұрын
ye
@marksargent32095 жыл бұрын
The best I've seen so far.
@BackToBackSWE5 жыл бұрын
haha thanks
@hs96875 жыл бұрын
definitely the best explanation for this question. thanks a lot!
@BackToBackSWE5 жыл бұрын
sure
@bhavyachawla71765 жыл бұрын
This video and that damn neatly commented code blew my mind . Thanks a lot !!!!!!! :D
@BackToBackSWE5 жыл бұрын
sure
@kadamdeepali20114 жыл бұрын
Superb explaination.. Thank you so much. I was struggling to solve this problem. After looking at video . It got cleared.
@BackToBackSWE4 жыл бұрын
sure
@sauravkumarjha28384 жыл бұрын
very clearly explained. thanks a lot.
@BackToBackSWE4 жыл бұрын
thanks
@harini31915 жыл бұрын
Your the best teacher ... Keep up the work!! please do post lots of videos like this!!.. Thanks for your efforts..
@BackToBackSWE5 жыл бұрын
ok, coming right up
@hbhavsi5 жыл бұрын
Bless you dude! Great explanation and very well documented solution.
@BackToBackSWE5 жыл бұрын
Thanks, wassup
@Justin-yq8hf3 жыл бұрын
Thanks for pointing out the time complexity
@darshansimha21663 жыл бұрын
Thank you 🙏 . Really helped me visualize the backtracking.