Egg Dropping Problem: Dynamic Programming Fundamentals & Understanding Subproblem Decomposition

  ΠŸΠ΅Ρ€Π΅Π³Π»ΡΠ΄Ρ–Π² 107,510

Back To Back SWE

Back To Back SWE

Π”Π΅Π½ΡŒ Ρ‚ΠΎΠΌΡƒ

Free 5-Day Mini-Course: backtobackswe.com
Try Our Full Platform: backtobackswe.com/pricing
πŸ“Ή Intuitive Video Explanations
πŸƒ Run Code As You Learn
πŸ’Ύ Save Progress
❓New Unseen Questions
πŸ”Ž Get All Solutions
Question: You are given n eggs and specified a number of k floors. Write an algorithm to find the minimum number of drops is required to know the floor from which if the egg is dropped, it will break.
Note: There are more optimal solutions than this approach, but in a 45-minute interview they seem to me unreasonable to get. So I covered what one could reasonably deduce given they have never seen this question.
Complexities
Time: O( totalEggs * totalFloors^2 )
We will have totalEggs * totalFloors subproblems and spend O(totalFloors) time computing each subproblem.
Space: O( totalEggs * totalFloors )
We can upper bound to the number of subproblems which will be totalEggs * totalFloors subproblems (whether you include the base cases or not in the memoization table)
++++++++++++++++++++++++++++++++++++++++++++++++++
HackerRank: / @hackerrankofficial
Tuschar Roy: / tusharroy2525
GeeksForGeeks: / @geeksforgeeksvideos
Jarvis Johnson: / vsympathyv
Success In Tech: / @successintech

ΠšΠžΠœΠ•ΠΠ’ΠΠ Π†: 457
@BackToBackSWE
@BackToBackSWE 5 Ρ€ΠΎΠΊΡ–Π² Ρ‚ΠΎΠΌΡƒ
Table of Contents: Intro 0:00 - 0:24 The Problem Introduction 0:24 - 2:39 Base Case #1: 1 Egg 2:39 - 6:21 Base Case #2: 0 or 1 Floors 6:21 - 8:47 Summarizing Our Base Cases 8:47 - 10:18 The Simulation. 6 Floors, 3 Eggs 10:18 - 18:36 DP Table Walkthrough 18:36 - 22:06 Camera Dies. Finishing Explanation of The Simulation. 22:06 - 23:30 Time Complexity 23:30 - 24:12 Space Complexity 24:12 - 24:51 Wrap Up 24:51 - 25:19 Update 4/3/19: Both the Top Down & Bottom Up approaches shown in the video time out on Leetcode due to the test cases changing. The code for the problem is in the description (both bottom up and top down). Fully commented for understanding.
@fpv_am
@fpv_am 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Bro, just, aaaaaaaaaaaaaaaaaaah, just, aaaaaaaaaaaaaaaaaa, just, I applause you, thank youuuuuuuuuuuuuuuuuuuuuuu, brooo, I just cant express my feelings, aaaaaaa its so coooooooooooooool, I understood it!
@BackToBackSWE
@BackToBackSWE 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
yeah
@BackToBackSWE
@BackToBackSWE 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
hahahaha nice
@monil1601
@monil1601 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Yep, I got that but what's the recurrence relation for construction of the DP table? If we denote optimal solution by OPT(m,n) where we have m eggs and n floors then how will we write it in terms of recurrence ?
@BackToBackSWE
@BackToBackSWE 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
@@monil1601 I don't remember
@airysm
@airysm 5 Ρ€ΠΎΠΊΡ–Π² Ρ‚ΠΎΠΌΡƒ
These are some strong ass eggs
@BackToBackSWE
@BackToBackSWE 5 Ρ€ΠΎΠΊΡ–Π² Ρ‚ΠΎΠΌΡƒ
agreed
@raymondyoo5461
@raymondyoo5461 5 Ρ€ΠΎΠΊΡ–Π² Ρ‚ΠΎΠΌΡƒ
LOL
@ahmedboutaraa8771
@ahmedboutaraa8771 3 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
your channel is like a NETFLIX of DS & algorithms. whenever i try to watch one of your videos i found 10 more intriguing ones
@BackToBackSWE
@BackToBackSWE 3 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
haha nice
@chanman123
@chanman123 5 Ρ€ΠΎΠΊΡ–Π² Ρ‚ΠΎΠΌΡƒ
Just wanted to say how much I appreciate these videos. You're really doing a great job of helping all of us out here and I can't thank you enough!
@BackToBackSWE
@BackToBackSWE 5 Ρ€ΠΎΠΊΡ–Π² Ρ‚ΠΎΠΌΡƒ
I have to feed the family. Everyone eats. Otherwise, I'm starving.
@itsrahulraj
@itsrahulraj 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
I have been watching your videos recently and cant thank you enough for explaining hard puzzles in a layman's language. I haven't seen anyone who explain the actual "purpose" of the problem as you do. Well done and keep posting :)
@studgaming6160
@studgaming6160 5 Ρ€ΠΎΠΊΡ–Π² Ρ‚ΠΎΠΌΡƒ
I have watched several videos but none of them was as good as this one. Awesome job dude. Thank U. All the videos talk about solution without explaining subproblems of dynamic programming. But you explained it really well my friend.
@BackToBackSWE
@BackToBackSWE 5 Ρ€ΠΎΠΊΡ–Π² Ρ‚ΠΎΠΌΡƒ
nice
@chaitanyapvs4150
@chaitanyapvs4150 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Its nice to find a video explaining way of approach rather than repeating the dp tables from solutions.Thanks man.
@BackToBackSWE
@BackToBackSWE 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
sure
@chetansahu1505
@chetansahu1505 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
You are the best mentor that I've ever seen in my life. You can even make a fool understand the complex concepts. (y) keep up the work bro :)
@BackToBackSWE
@BackToBackSWE 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
hahaha, u gonna be a genius
@codetolive27
@codetolive27 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
It's very clear that you have put in a lot of effort to come up detailed explanation. Thank you keep up the good work.
@BackToBackSWE
@BackToBackSWE 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
thanks
@rakeshsinha9541
@rakeshsinha9541 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
I Really like the way how you're explaining the problem thoroughly
@BackToBackSWE
@BackToBackSWE 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
thx
@vaibhavlodha5398
@vaibhavlodha5398 5 Ρ€ΠΎΠΊΡ–Π² Ρ‚ΠΎΠΌΡƒ
Thank you very much for these videos, they are really great. I seriously have no words to express my gratitude for these wonderful videos. Great job !
@BackToBackSWE
@BackToBackSWE 5 Ρ€ΠΎΠΊΡ–Π² Ρ‚ΠΎΠΌΡƒ
Say no words, let it be :) As a wise man once said: "Let it be, let it be, let it be, let it be There will be an answer, let it be" - Wayne Gretzky
@martinberridge9173
@martinberridge9173 3 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
These videos are the best I've seen on algorithms/problem solving on UKposts. Not code walkthroughs or dry mathematical proofs just the facts!
@BackToBackSWE
@BackToBackSWE 3 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
thx!
@krishnakrmahto97
@krishnakrmahto97 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
I can see the amount of effort you've been putting on your videos. This is what I had been looking for the last 2 years. I feel very lucky that you started making videos before I graduate.
@BackToBackSWE
@BackToBackSWE 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
dang...that's a long search hahaha, and thanks haha...more are a comin'
@krishnakrmahto97
@krishnakrmahto97 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
@@BackToBackSWE looking forward to all of 'em!
@BackToBackSWE
@BackToBackSWE 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
@@krishnakrmahto97 nice
@MMOlocation
@MMOlocation 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Thank you so much for your effort. You can't even imagine how much these help.
@BackToBackSWE
@BackToBackSWE 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
nice
@tanvirarjel
@tanvirarjel Π Ρ–ΠΊ Ρ‚ΠΎΠΌΡƒ
One of the best explanations for this problem on the internet. ❀
@allezzthepunk
@allezzthepunk 3 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
I am almost in tears for how good this is explained
@yashshreeshinde4394
@yashshreeshinde4394 3 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Your teaching are very clean and understandable ,I am glad to get a teacher like you in my journey of career.You deserve more subscribers.Good luck ,keep it up!🌈✨
@BackToBackSWE
@BackToBackSWE 3 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
thx!
@faridashaikh9773
@faridashaikh9773 3 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
I really like the way you teach, with so much clarity and to the point... Keep going πŸ’ͺ Thankyou
@BackToBackSWE
@BackToBackSWE 3 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
thx
@kuralamuthankathirvelan
@kuralamuthankathirvelan 5 Ρ€ΠΎΠΊΡ–Π² Ρ‚ΠΎΠΌΡƒ
One (Back To Back SWE) video per day keeps tushar roy away !🀣🀣🀣
@BackToBackSWE
@BackToBackSWE 5 Ρ€ΠΎΠΊΡ–Π² Ρ‚ΠΎΠΌΡƒ
hahaha CALM DOWN
@karthikrangaraju9421
@karthikrangaraju9421 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Respect for both, for the lack of good dynamic programming videos, Tushar pioneered it well imo. Ben is teaching it better with the intuition behind things, can’t deny that either :)
@anunaysharma2718
@anunaysharma2718 3 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
@@abhimishra2276 what's wrong with them?
@ritwik121
@ritwik121 3 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
@@abhimishra2276 abdul bari is good
@abhimishra2276
@abhimishra2276 3 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
@@ritwik121 yes bro i was so wrong he is amazing
@hoelefouk
@hoelefouk 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Keep up the good work and keep making our life easier!!
@BackToBackSWE
@BackToBackSWE 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
ok
@ShaliniNegi24
@ShaliniNegi24 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
One of the best explanation. Thank you, sir!
@BackToBackSWE
@BackToBackSWE 3 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
thanks and sure
@shashikantpunia9019
@shashikantpunia9019 3 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
how easily i understood that tough problem signifies that level of teaching of ben...he has fabulous teaching skills.
@BackToBackSWE
@BackToBackSWE 3 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
thanks
@vibekdutta6539
@vibekdutta6539 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
You are really gr8, thanks sir! I hope you do Great things in life! Respect
@BackToBackSWE
@BackToBackSWE 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
sure thx
@zehrasubas9768
@zehrasubas9768 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Watched so many videos about this problem and got confused, this video made everything clear!
@BackToBackSWE
@BackToBackSWE 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
nice
@tastypie2276
@tastypie2276 Π Ρ–ΠΊ Ρ‚ΠΎΠΌΡƒ
Sir, you're one of the best algorithm teachers I've ever seen! Your explanations are really fascinating!
@BackToBackSWE
@BackToBackSWE Π Ρ–ΠΊ Ρ‚ΠΎΠΌΡƒ
Thank you, appreciate it πŸ˜„ Also check out our Free 5 Day DSA Interview Prep Mini-Course - backtobackswe.com/ πŸŽ‰
@ruchadeodhar1708
@ruchadeodhar1708 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Awesome explanation !! Thank you so so much!
@BackToBackSWE
@BackToBackSWE 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
sure
@erichlf
@erichlf 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
By far the best explanation of the egg drop problem I have come across.
@BackToBackSWE
@BackToBackSWE 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
thx
@priyanktewari8841
@priyanktewari8841 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Too good bro! Dead camera was a bummer but great explanation!
@BackToBackSWE
@BackToBackSWE 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
haha
@dongshuowu3454
@dongshuowu3454 5 Ρ€ΠΎΠΊΡ–Π² Ρ‚ΠΎΠΌΡƒ
I couldn't believe this amazing channel only has 13K subs.
@BackToBackSWE
@BackToBackSWE 5 Ρ€ΠΎΠΊΡ–Π² Ρ‚ΠΎΠΌΡƒ
Aw, thanks. I work pretty hard on this. I hope it grows. I've put my life into this.
@bddyonetim539
@bddyonetim539 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
@@BackToBackSWE It is the greatest channel that I have found out...Thanks a lot...
@UnseenVivekC
@UnseenVivekC 5 Ρ€ΠΎΠΊΡ–Π² Ρ‚ΠΎΠΌΡƒ
I have been trying to understand this problem through many YoutTubers,but lemme tell you Sir, this is the best explanation I had. Keep the work up Sir.
@BackToBackSWE
@BackToBackSWE 5 Ρ€ΠΎΠΊΡ–Π² Ρ‚ΠΎΠΌΡƒ
thank you. stay around. we got a long road ahead
@UnseenVivekC
@UnseenVivekC 5 Ρ€ΠΎΠΊΡ–Π² Ρ‚ΠΎΠΌΡƒ
@@BackToBackSWE Yes, sir I will.
@BackToBackSWE
@BackToBackSWE 5 Ρ€ΠΎΠΊΡ–Π² Ρ‚ΠΎΠΌΡƒ
@@UnseenVivekC haha ok
@al-farouksaleh2144
@al-farouksaleh2144 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Where are the codes dude, we really need them. Ps: you’re a life saver, keep going βœŒπŸ»πŸ’™
@BackToBackSWE
@BackToBackSWE 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
thanks and we only maintain code on backtobackswe.com
@rashim
@rashim 3 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Here's the code link: ukposts.info?q=https%3A%2F%2Fgithub.com%2Fbephrem1%2Fbacktobackswe%2Ftree%2Fmaster%2FDynamic%2520Programming%252C%2520Recursion%252C%2520%2526%2520Backtracking%2FEggDrop&redir_token=QUFFLUhqbnQ3T2tXamxoVTh5c205TlJCYjZCYmZsOWNjZ3xBQ3Jtc0trODRCQlRicjVIbXh0dXk5VEhrel9QQkZUNXFRamMzSVdablYxLUE5aVk3RGxrRUFOMjNTQkRWSk1qeFlrcVk1cEVIUU51b3E5X3dtSXh2M0FGcmxPY0ZiUFU5eTU4YjhuMDZYckl3YXNDeTQ2UFJIQQ%3D%3D&event=comments&stzid=UgzKhQ0U7vTf35sZifd4AaABAg
@MithleshKumar-iz1dz
@MithleshKumar-iz1dz 5 Ρ€ΠΎΠΊΡ–Π² Ρ‚ΠΎΠΌΡƒ
Thanks a lot, BTB SWE for crystal clear explanation, I always think in a Top to Down DP approach but always got confused in Bottom Up DP. Can you people make another separate video for thinking ina bottom up DP please?
@BackToBackSWE
@BackToBackSWE 5 Ρ€ΠΎΠΊΡ–Π² Ρ‚ΠΎΠΌΡƒ
Yes. I will address this in a video similar to this: ukposts.info/have/v-deo/kqFlqaaLfJeC2oE.html one day. Don't worry, as long as this project stays active I will cover what people want to see.
@tejasghone5118
@tejasghone5118 3 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Great clarification of the problem!! This was my 3rd vdeo for the egg problem and now i am satisfied!
@BackToBackSWE
@BackToBackSWE 3 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
great
@mrinaldhawan3959
@mrinaldhawan3959 5 Ρ€ΠΎΠΊΡ–Π² Ρ‚ΠΎΠΌΡƒ
Your channel is great and really helping me with learning and understanding Dynamic Programming. I wanted to know, can this problem be solved optimally using Jump Search Algorithm?
@BackToBackSWE
@BackToBackSWE 5 Ρ€ΠΎΠΊΡ–Π² Ρ‚ΠΎΠΌΡƒ
thanks and not sure, I've never heard of Jump Search
@mrinaldhawan3959
@mrinaldhawan3959 5 Ρ€ΠΎΠΊΡ–Π² Ρ‚ΠΎΠΌΡƒ
www.google.com/amp/s/www.geeksforgeeks.org/jump-search/amp/
@sehejwahla410
@sehejwahla410 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Great work bro !! God bless you !!
@BackToBackSWE
@BackToBackSWE 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
sure
@rati396
@rati396 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
very good and detailed explanation , thank you !
@BackToBackSWE
@BackToBackSWE 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
sure
@hamidurrahman3183
@hamidurrahman3183 5 Ρ€ΠΎΠΊΡ–Π² Ρ‚ΠΎΠΌΡƒ
Thank you, Lord. Finally found a video that can help. I wish I had this person teaching my algorithm class instead of my prof who looks at her notes and talks to the board.
@BackToBackSWE
@BackToBackSWE 5 Ρ€ΠΎΠΊΡ–Π² Ρ‚ΠΎΠΌΡƒ
Hahahahahaha. Yes.
@itslucaxbitch69
@itslucaxbitch69 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
How can I not understand if you teach this so beautifully!
@BackToBackSWE
@BackToBackSWE 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
haha thanks
@Ashish-_-
@Ashish-_- 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
I want to thank you sir for you really put in so much effort into these videos.I like the fact that you provide links to other channels too ( Like Tushar Roy etc).
@BackToBackSWE
@BackToBackSWE 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
yeah haha, this is meant to be a resource of many
@anonymousvoid6356
@anonymousvoid6356 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Nice explanation man!
@bruriahassidim8369
@bruriahassidim8369 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Thank you very much for these videos really helpful! just one question. I get it when we have one egg, so we just go one floor upwards at each time and if it breaks we know it's one floor below but how does having more eggs help me? am I throwing from a few more floors at the same time? I am missing something
@BackToBackSWE
@BackToBackSWE 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
A few more eggs would allow us to not have to drop every floor up to the breaking floor
@vijay6877
@vijay6877 3 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Loved your video. Thank you so much.
@prabhpreetsingh5341
@prabhpreetsingh5341 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Its my first time watching your video and I gotta tell it "MAN U HAVE EARNED MY RESPECT" seriously man can just emphazize on how much easy u did this to me . . Just a single problem ... ur code link redirects to a page not found ... look up for that
@BackToBackSWE
@BackToBackSWE 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Thanks and got it
@matthewbuchholz5251
@matthewbuchholz5251 3 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
I know this would be a difficult one to make, but you should make a video going over techniques for identifying overlapping subproblems and optimal substructure in DP problems in general. Pulling from examples like this and longest non-decreasing subsequence (and your other vids). Basically, abstracting the problem specific examples and giving some practical tips for how to identify subproblems. Fingers crossed xD
@BackToBackSWE
@BackToBackSWE 3 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
ok
@aamirjamal6833
@aamirjamal6833 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
These have to be some hard ass eggs man.. Thanks for the lucid explanation bro..
@BackToBackSWE
@BackToBackSWE 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
ye
@vedantverma5185
@vedantverma5185 Π Ρ–ΠΊ Ρ‚ΠΎΠΌΡƒ
Commendable explanation !
@Pickyricky69420
@Pickyricky69420 3 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
My GUY!!! You are brilliant! I will invest my tuition to a service you provide. Take my money!
@raymondyoo5461
@raymondyoo5461 5 Ρ€ΠΎΠΊΡ–Π² Ρ‚ΠΎΠΌΡƒ
I know you have your own plan, but I have a suggestion. Recently I started learning 'parametric search' and I find it tricky. -> what is the proper condition to be put in "while( )" ??? -> when do I put '=' on "if (K < mid)", and when do I put '=' on "if (mid < K)" ??? I don't wanna break your pace, just wanted to give you an idea. thx!
@BackToBackSWE
@BackToBackSWE 5 Ρ€ΠΎΠΊΡ–Π² Ρ‚ΠΎΠΌΡƒ
Not familiar with parametric search. Is it related to binary search?
@raymondyoo5461
@raymondyoo5461 5 Ρ€ΠΎΠΊΡ–Π² Ρ‚ΠΎΠΌΡƒ
@@BackToBackSWE I heard it is highly relevant to binary search. I found some example questions, I'll add the links here. Question 1 ) hsin.hr/coci/archive/2011_2012/contest5_tasks.pdf -- Question #2 (It starts with the sentence "Lumberjack Mirko needs to chop down M metres of wood....") Question 2 ) www.acmicpc.net/problem/3703 Question 3 ) poj.org/problem?id=3273 I think I can solve above questions applying binary search... Do you agree? Or any better method to solve them???
@FloShaban
@FloShaban 5 Ρ€ΠΎΠΊΡ–Π² Ρ‚ΠΎΠΌΡƒ
Great job, you deserve more subs than most others who do these type of videos. However, can you go in depth a bit on what you'd need to simulate all of the floors? Why can't you just start branching from 6 floors, 3 eggs?
@BackToBackSWE
@BackToBackSWE 5 Ρ€ΠΎΠΊΡ–Π² Ρ‚ΠΎΠΌΡƒ
We do. To solve the subproblem you just stated: drop(3, 6) -> we need to imagine, just imagine...that we start dropping from floor 1 with 3 eggs, floor 2 with 3 eggs, floor 3 with 3 eggs, floor 4 with 3 eggs, etc. At each simulation, we want to know the 2 possibilities. What do they yield in terms of worst drops. This is how we converge to base cases. Now, to your question. Why simulate? Well...what was the original question: "You are given n eggs and specified a number of k floors. Write an algorithm to find the minimum number of drops is required to know the floor from which if the egg is dropped, it will break." How can I know FOR SURE...for sure...the MINIMUM # of drops to find the pivotal floor? Well for the solution presented (and there are others) we do a test from each floor and find the WORST performer. This worst performance is a possible reality. We must account for it. And thus, we take this worst reality/outcome AFTER DROPPING. After dropping. If we miss out on any simulation we will miss a possible outcome that may worsen our worst case. This brings me to why we add 1. The +1 is because we want to say that "The answer where I stand is the action I take, plus the result of the worst outcome that follows." the action. A drop. +1 to the worst case drops. the result. That is the worst subproblem result that happens after our action. I could keep going but check the code in the description. Keep asking questions. I have answers...most of the time.
@Maholain
@Maholain 5 Ρ€ΠΎΠΊΡ–Π² Ρ‚ΠΎΠΌΡƒ
Here's another way to look at it: think about every call to drop(eggs, floor) as literally throwing one of your eggs down from the chosen floor. So if you computed drop(3, 6) by only considering the 6th floor (instead of testing all the floors), what you are saying is - what is the minimum number of times I need to throw eggs off of floors to find the first floor it breaks... *given that you threw your FIRST egg off the 6th floor?* As you can imagine, we might be able to reduce the number of drops in the worst case by dropping the FIRST egg off, say, the third floor - (drop(3, 3)) - if it breaks, you've eliminated the top half of floors, and if it doesn't, you've eliminated the bottom half (had we just thrown it off the highest floor each time, if the egg breaks, we would have only eliminated one floor; if the egg broke from that floor, only one more floor, and so on). Of course, we don't really know which floor to drop off first to minimize the number of drops, so we try each floor. This reflects the floor we should throw our egg off first!
@FloShaban
@FloShaban 5 Ρ€ΠΎΠΊΡ–Π² Ρ‚ΠΎΠΌΡƒ
@@Maholain Thank you, and thank you both. :)
@BackToBackSWE
@BackToBackSWE 5 Ρ€ΠΎΠΊΡ–Π² Ρ‚ΠΎΠΌΡƒ
@@FloShaban I still feel like I could've made it clearer...oh well. There are better solutions but I just covered the most basic solution one would realistically get with previous dp experience.
@hunterhe5161
@hunterhe5161 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
amazing!You are a good teacher.Thank you.
@BackToBackSWE
@BackToBackSWE 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
thx
@overclockinggames2419
@overclockinggames2419 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
I want to see you and Tushar in one frame πŸ˜‚. Anyways amazing explanation as always .
@BackToBackSWE
@BackToBackSWE 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
ok
@palashkamble2325
@palashkamble2325 3 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Hey, can you make a video for O(K*log N) approach?
@BackToBackSWE
@BackToBackSWE 3 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Right now cannot but would if I had the time
@cristianouzumaki2455
@cristianouzumaki2455 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
after watching several videos on this topic, this video proved out to be the best as always. explanations were very clear although the hiccup in the end disrupted the flow.
@BackToBackSWE
@BackToBackSWE 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
thx
@vicliur2
@vicliur2 3 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Wow Thanks for the explanation man!
@BackToBackSWE
@BackToBackSWE 3 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
sure!
@chaithanyavarma7618
@chaithanyavarma7618 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Just Brilliant!!
@ChainForLife
@ChainForLife 5 Ρ€ΠΎΠΊΡ–Π² Ρ‚ΠΎΠΌΡƒ
Hey great video, just a quick question, why is it that the minimum amount of egg drops for n floors is n? Wouldn't it be log(n) times since we can do sort of a binary search where we drop an egg from (n/2)th floor and if it breaks we know every egg dropped from above that floor will break and if it doesn't break we know that every egg dropped from below that floor won't break ?
@BackToBackSWE
@BackToBackSWE 5 Ρ€ΠΎΠΊΡ–Π² Ρ‚ΠΎΠΌΡƒ
We can do it logarithmically, that is the next best solution. I just presented the base solution that someone could practically come up with in an interview.
@ChainForLife
@ChainForLife 5 Ρ€ΠΎΠΊΡ–Π² Ρ‚ΠΎΠΌΡƒ
@@BackToBackSWE I see. Can I ask you just one more question? Why is it that we want the worst outcome of the drops, that is max(drop(eggs, totalFloor - currentFloor), drop(eggs - 1, currentFloor - 1)) ? This part still doesn't seem to click in my head.
@BackToBackSWE
@BackToBackSWE 5 Ρ€ΠΎΠΊΡ–Π² Ρ‚ΠΎΠΌΡƒ
@@ChainForLife Never limit questions. Always ask questions until you understand. Push the teacher as well as yourself because I don't know it all...or else we both learn nothing. So think about this....our goal is to tell the caller the SMALLEST amount of drops so that I can PROMISE that in those drops...I will find the pivotal floor. If I don't account for the worst outcome of drops...I could be lying...my promise could be broken. I have to take into account the WORST outcome and BOUND my drops to that because it promises that I find the pivotal floor in that amount of drops NO MATTER WHAT CASE happens. Does that make sense?
@ChainForLife
@ChainForLife 5 Ρ€ΠΎΠΊΡ–Π² Ρ‚ΠΎΠΌΡƒ
@@BackToBackSWE Yes sir, that last sentence pretty much made it crystal clear for me.
@BackToBackSWE
@BackToBackSWE 5 Ρ€ΠΎΠΊΡ–Π² Ρ‚ΠΎΠΌΡƒ
@@ChainForLife Ok, cool, haha don't "sir" me...I'm just a dude...a normal guy.
@Kasfas
@Kasfas 6 місяців Ρ‚ΠΎΠΌΡƒ
Question: Would this problem also be solved by a piecewise function of binary and linear search where you do binary search until eggnum == 1, then do linear search from the minpointer to the maxpointer? If I’m right and this is the case, the runtime complexity should be O(Height)/Θ(log(Height)), and space complexity O(1)? Also, pretty good job explaining the question in terms of DP. :)
@user-jq1jx1lg8v
@user-jq1jx1lg8v 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Best explanation ever!
@VocalWithShubham
@VocalWithShubham 3 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Hi Benyam, I just want to say that can you make a video that explains the optimal version of this algorithm with takes O(totalEggs*totalFloors) time or any lesser time because this code showing TLE in interviewbit and leetcode as they both have large input constraints. I can't able to understand their solution and also there is no video that explains that optimized solution.
@BackToBackSWE
@BackToBackSWE 3 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
I currently cannot due to time constraints Im sorry
@karmavadaa
@karmavadaa 3 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Great explanation!! Egg Drops, from floor’s and not breaking its unsettling though!! Going to think of it as Coconut Drop 😐
@Skaguc
@Skaguc Π Ρ–ΠΊ Ρ‚ΠΎΠΌΡƒ
Hey, thanks for the explanation! The cases where the egg breaks seems logical, but I don't get the case where the egg doesn't break. If the egg doesn't break on floor 5 why i can use the function for 6-5 = 1 floor? When the egg survives the fall from floor 5, it must also stay unharmed when dropped from floor 1...
@MyGroo
@MyGroo 3 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
The diagram starting at 12:52 was a bit misguiding the first time I saw it, because the first 6 tree levels don't represent the same thing as the second pairs of "possibilities". In reality, the solution for just one of the subproblems (e.g. 5F, 3E in this list) needs to iterate again through simulations for all 5 floors (with both break/non-break possibilities). And then each of those smaller subproblems again needs to iterate through a bunch of floor-egg pairs. This is where the (F, E) pairs begin reappearing and the memoization (caching) of the subproblems leads to DP. One useful way of looking at it is to realize that the solution to (4F, 3F) is the same regardless of whether we are considering top 4 floors or bottom 4 floors - it doesn't matter and we will end up calculating them twice unless we cache them or use DP to get them ahead of time.
@BackToBackSWE
@BackToBackSWE 3 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Hey - I dont remember this problem enough to answer this, shot this a while back
@shubhamdubey2283
@shubhamdubey2283 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
at 20:50 You said that the answer is the one who do the worst but I think it minimum of "all the worst case possibilities at each floor" for a corresponding (eggs and floors)
@BackToBackSWE
@BackToBackSWE 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
yes
@notexlol3125
@notexlol3125 3 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
I have seen tons of your videos, and I never found the code in the description. Could you please tell me where is it exactly?
@BackToBackSWE
@BackToBackSWE 3 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
The repository is deprecated, we only maintain backtobackswe.com now.
@orion_222
@orion_222 Π Ρ–ΠΊ Ρ‚ΠΎΠΌΡƒ
well explained.
@chakshujain7557
@chakshujain7557 3 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
I don't know but I really like watching your videos. Feels so much satisfaction.
@BackToBackSWE
@BackToBackSWE 3 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
thanks
@markfishman5242
@markfishman5242 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
good video. I was with you until min 20:47. Why do you have drop (2,1) in addition to drop (2,2). I get the 2,2 one, but since 2 eggs,1 floor cell was a 1, why that one ?
@BackToBackSWE
@BackToBackSWE 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
I fudged making that part clear - I remember this vividly, I'd go in and explain but I'm rapid fire responding to 250 comments I got backed up after 2 weeks
@jomosis9234
@jomosis9234 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
In the case (2,1), you are on the Floor 1,just by using one egg, you would know which floor is the "won't break"(I will use F below) floor. If the egg breaks on Floor 1, then "F" floor will be Floor 0. Otherwise will be Floor 1. Only Floor 1 and Floor 0 are to be discussed in case(2,1). totalFloor = 1 is a base case, no matter how many eggs there are, the answer is always 1.
@jomosis9234
@jomosis9234 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Thanks for your perfect explanation!But for your code, I have one question. Why do you plus one here " int accountingForDroppingAtThisSubproblem = 1 + costOfWorstOutcome;" You mentioned that you were doing a test.Can you explain the test clearly?I'm feeling quite confused.
@BackToBackSWE
@BackToBackSWE 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
The +1 denotes dropping an egg then solving the remaining subproblems passing the resulting state change to the next call
@jomosis9234
@jomosis9234 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
@@BackToBackSWE Thx!
@BackToBackSWE
@BackToBackSWE 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
@@jomosis9234 sure
@architranjan9
@architranjan9 3 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
The n^2*k dp solution as discussed in the video is giving tle on leetcode after 80 test cases or so!
@BackToBackSWE
@BackToBackSWE 3 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
yes
@shahar7
@shahar7 3 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
If looking at finding floor is like finding an item in an array, then it will be an easy math calculation of if (eggs == 1) return floors // "floor by floor method" if (eggs >= log(floors)) return log(floors); "simple binary search" else // this is a mix of the two approaches - we want to start a binary search until we have one egg left. divide the floors by 2 and assume the egg will break in every test. do this until we have the chunk size we have to go with the "floor by floor" method and drop. so overall it's the amount of dividing by 2 we can do + the size of the chunk that is left also, this - while can probably be improved to a single formula but you said at the end of the video no hard math time = O(log(eggs)) space = O(1) I really wonder what am I missing here
@BackToBackSWE
@BackToBackSWE 3 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Im not sure I dont remember anything in this video
@akshatsamdani
@akshatsamdani Π Ρ–ΠΊ Ρ‚ΠΎΠΌΡƒ
Can't find the code in the description. Also, not available on the site. :(
@thanga2317
@thanga2317 3 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Thanks for the detailed explanation : // if egg breaks then egg-1 and floor -1 ==> dp[e - 1][k - 1] // else no change in egg count and remaining floors which is f-k ==> dp[e][f - k] // k means which floor we are in -- > first floor , second floor // 2 Eggs -> 3 Floors // β€’ 2 Eggs -> lets try from 1st Floor-> 1,0 ,, 2,2 // β€’ 2 Eggs -> lets try from 2nd Floor -> 1,1 ,, 2,1 // 2 Eggs -> lets try from 3rd Floor -> 1,2 ,, 2,0
@anmoljhanwar5843
@anmoljhanwar5843 3 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
I am unable to find the implemented code in description .Where should i be looking?
@varunagarwal5189
@varunagarwal5189 3 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
best explanation to this problem so far
@BackToBackSWE
@BackToBackSWE 3 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
thanks
@chandnibhatia1211
@chandnibhatia1211 Π Ρ–ΠΊ Ρ‚ΠΎΠΌΡƒ
Hey amazing explanation!!! BTW where is the code !?
@BackToBackSWE
@BackToBackSWE Π Ρ–ΠΊ Ρ‚ΠΎΠΌΡƒ
Hi, the code is maintained on www.backtobackswe.com
@adnanmasroor742
@adnanmasroor742 3 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
finally I am beginning to understand the problem!!
@dareenalhiyari8259
@dareenalhiyari8259 3 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Watched it while on the treadmill, nicely explained, just wish your cam didn't die
@BackToBackSWE
@BackToBackSWE 3 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
lmao nice
@flarros
@flarros 3 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
So I'm taking an algorithm design course and while this is great for a coding interview, I actually need the mathematical intuition to be able to derive an equation that will work for any number of floors or eggs. Does someone know a resource for helping to understand that side of things?
@BackToBackSWE
@BackToBackSWE 3 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
noted, I'm not sure
@sahilk335
@sahilk335 5 Ρ€ΠΎΠΊΡ–Π² Ρ‚ΠΎΠΌΡƒ
At 20:59 When we want value for drop(2,2) , then, Why do we simulate sim(2,1) & sim(2,2) . we are solving for is 2 (which is 'totalFloors') floors and 2 (which is 'totalEggs') eggs. We are doing 2 simulations: sim(2, 1) (2 eggs, start from floor 1) and sim(2, 2) (2 eggs, start from floor 2). why not just sim(2,1) ? beacuse sim(2,2) is bad choice... right ?
@BackToBackSWE
@BackToBackSWE 5 Ρ€ΠΎΠΊΡ–Π² Ρ‚ΠΎΠΌΡƒ
"why not just sim(2,1)?" If we just do one of the simulations (and not all of them) we may miss a case that would've yielded a truer bound to the worst amount of eggs that would need to be dropped to ensure we find the pivotal floor. For the approach in the video (and it is not the most optimal approach), we have to run all simulations to ensure our upper limit is correct with such a guarantee.
@demidrek-heyward
@demidrek-heyward 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
You always say that the code is in the description but I never see it? Did this get moved to your subscription service? Either way thanks!
@BackToBackSWE
@BackToBackSWE 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Hey, we had a public repository and we have deprecated it and only maintain backtobackswe.com from now on
@dnield
@dnield 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
unsubscribed
@demidrek-heyward
@demidrek-heyward 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
@@BackToBackSWE okay gotcha i found it and thanks again!
@cautioni
@cautioni 3 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
where is the link to your code?
@ihtemad
@ihtemad 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
brother, YOU MUST MAKE A VIDEO ON MANACHER"S ALGORITHM!No video is enough clear. Please make one ASAP
@BackToBackSWE
@BackToBackSWE 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Can't right now
@reassume4826
@reassume4826 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Did u find one?
@danneal3735
@danneal3735 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Thank you very much
@BackToBackSWE
@BackToBackSWE 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
sure
@navaneethakrishnanp8400
@navaneethakrishnanp8400 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Great explanation
@BackToBackSWE
@BackToBackSWE 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
thanks
@mooesaad
@mooesaad 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
I love your channel but you have not posted in a while. If you do get time, would you be able to do Two city scheduling problem? It is a dynamic programming problem. :)
@BackToBackSWE
@BackToBackSWE 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Hey, we have been working on a huge platform in the past 3 months. It launches in 2-3 weeks.
@gurleenkaur5786
@gurleenkaur5786 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Can binary search be applied to this problem..like in this particular ques..try the middle floor i.e 3rd floor..if the egg does not break then consider only 3-6 floors and check on mid..let's say 4th floor..otherwise check on 0-3 floors..can it be done this way?
@BackToBackSWE
@BackToBackSWE 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
yes
@TheDEMMX
@TheDEMMX 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
@@BackToBackSWE Thank you for your videos. I thought about binary search too, why DP if we can use binary search. The worst case is a function of floors only, not the eggs. Then at the end, you either have enough eggs or you don't? Or am I missing something in the problem statement?
@kwanji.feb2
@kwanji.feb2 3 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
This is the most explaination of this type of dp :>
@christofrank4862
@christofrank4862 3 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Amazing bro!!...
@BackToBackSWE
@BackToBackSWE 3 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
thanks
@skullblank4623
@skullblank4623 3 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
tysm man this helped a lot :)
@alieltoney
@alieltoney 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
in which order do i have to watch your dynamic programming series ?
@BackToBackSWE
@BackToBackSWE 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
not sure, any
@alieltoney
@alieltoney 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
@@BackToBackSWE it won't affect my understanding ?
@BackToBackSWE
@BackToBackSWE 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
@@alieltoney what
@jiaonao5463
@jiaonao5463 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
cool! good video!
@amartyamishra6961
@amartyamishra6961 11 Π΄Π½Ρ–Π² Ρ‚ΠΎΠΌΡƒ
Where is the code? Am I mistaking the place where the description is supposed to be?
@ankitgoyal8556
@ankitgoyal8556 27 Π΄Π½Ρ–Π² Ρ‚ΠΎΠΌΡƒ
I don't where you are these days, when I was fresher I learnt from your videos. Now I have experience of 3 years and I am still learning from you. Am I in love with you ? 😜
@waxylayer8353
@waxylayer8353 3 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
I got my first job ( 18 lpa ) all coz of your videos.... Thanks a lot dude .. keep helping people ❀️
@BackToBackSWE
@BackToBackSWE 3 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
nice, best of luck internet friend
@waxylayer8353
@waxylayer8353 3 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
@@BackToBackSWE thank you so much 🀩🀩
@lokeshsenthilkumar4522
@lokeshsenthilkumar4522 3 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
@@waxylayer8353 Hey bro, Are you a Tamilian?
@waxylayer8353
@waxylayer8353 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
@@lokeshsenthilkumar4522 yes
@vaibhavsinha2728
@vaibhavsinha2728 3 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Where is the code , please help me to find it...
@Blixy95
@Blixy95 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Adding the recurisve function would make it perfect
@BackToBackSWE
@BackToBackSWE 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
yes
@jiradetounjai8307
@jiradetounjai8307 5 Ρ€ΠΎΠΊΡ–Π² Ρ‚ΠΎΠΌΡƒ
Thank you for the very clear explanation. I am confused that when an egg does not break we go up (totalFloors - currentFloor), but at 21:35, why totalFloors is 2 instead of 4 as shown in the table.
@BackToBackSWE
@BackToBackSWE 5 Ρ€ΠΎΠΊΡ–Π² Ρ‚ΠΎΠΌΡƒ
Our subproblem we are solving for is 2 (which is 'totalFloors') floors and 2 (which is 'totalEggs') eggs. We can do 2 simulations: sim(2, 1) (2 eggs, start from floor 1) and sim(2, 2) (2 eggs, start from floor 2). Where is 4 coming from?
@Qrzychu92
@Qrzychu92 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
Great video, but I really think that you should do binary search instead of going one floor up and down, would be much less drops and much more saved eggs :)
@BackToBackSWE
@BackToBackSWE 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
yeah that is the better approach.
@Qrzychu92
@Qrzychu92 4 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
@@BackToBackSWE I understand that you didn't do binary search for simplicity, but I think at least mentioning it as possible optimization would open some eyes. Keep the good work!
@ashishkumarchoubey5592
@ashishkumarchoubey5592 2 Ρ€ΠΎΠΊΠΈ Ρ‚ΠΎΠΌΡƒ
I never am able to find code in description.
@thanga2317
@thanga2317 5 Ρ€ΠΎΠΊΡ–Π² Ρ‚ΠΎΠΌΡƒ
Thanks again :)
@BackToBackSWE
@BackToBackSWE 5 Ρ€ΠΎΠΊΡ–Π² Ρ‚ΠΎΠΌΡƒ
sure
Maximum Sum Rectangle In A 2D Matrix - Kadane's Algorithm Applications (Dynamic Programming)
27:05
Back To Back SWE
ΠŸΠ΅Ρ€Π΅Π³Π»ΡΠ΄Ρ–Π² 76 тис.
The N Queens Problem using Backtracking/Recursion - Explained
14:29
Back To Back SWE
ΠŸΠ΅Ρ€Π΅Π³Π»ΡΠ΄Ρ–Π² 133 тис.
How did CatNap end up in Luca cartoon?πŸ™€
00:16
LOL
ΠŸΠ΅Ρ€Π΅Π³Π»ΡΠ΄Ρ–Π² 4,9 ΠΌΠ»Π½
A touching meeting between the Russian MT-LB and the American-made Bradley #warinukraine #tanks
00:21
UNITED24
ΠŸΠ΅Ρ€Π΅Π³Π»ΡΠ΄Ρ–Π² 1,4 ΠΌΠ»Π½
Normal vs Smokers !! 😱😱😱
00:12
Tibo InShape
ΠŸΠ΅Ρ€Π΅Π³Π»ΡΠ΄Ρ–Π² 16 ΠΌΠ»Π½
Mastering Dynamic Programming - How to solve any interview problem (Part 1)
19:41
Tech With Nikola
ΠŸΠ΅Ρ€Π΅Π³Π»ΡΠ΄Ρ–Π² 551 тис.
The Quicksort Sorting Algorithm: Pick A Pivot, Partition, & Recurse
26:31
Back To Back SWE
ΠŸΠ΅Ρ€Π΅Π³Π»ΡΠ΄Ρ–Π² 161 тис.
1st place Egg Drop project ideas- using SCIENCE
9:49
Mark Rober
ΠŸΠ΅Ρ€Π΅Π³Π»ΡΠ΄Ρ–Π² 38 ΠΌΠ»Π½
I've Read Over 100 Books on Python. Here are the Top 3
9:26
Python Programmer
ΠŸΠ΅Ρ€Π΅Π³Π»ΡΠ΄Ρ–Π² 247 тис.
Total Ways To Decode A String - Recursive Dynamic Programming Approach ("Decode Ways" on LeetCode)
11:58
Back To Back SWE
ΠŸΠ΅Ρ€Π΅Π³Π»ΡΠ΄Ρ–Π² 76 тис.
Egg Dropping: Going beyond just solving the classic puzzle
22:23
James Tanton
ΠŸΠ΅Ρ€Π΅Π³Π»ΡΠ΄Ρ–Π² 10 тис.
Egg Dropping Problem Dynamic Programming | Leetcode Hard Solutions
48:57
Pepcoding
ΠŸΠ΅Ρ€Π΅Π³Π»ΡΠ΄Ρ–Π² 61 тис.
Count Total Unique Binary Search Trees - The nth Catalan Number (Dynamic Programming)
14:18
Back To Back SWE
ΠŸΠ΅Ρ€Π΅Π³Π»ΡΠ΄Ρ–Π² 63 тис.
Can you solve the egg drop riddle? - Yossi Elran
4:47
TED-Ed
ΠŸΠ΅Ρ€Π΅Π³Π»ΡΠ΄Ρ–Π² 8 ΠΌΠ»Π½
Why spend $10.000 on a flashlight when these are $200πŸ—Ώ
0:12
NIGHTOPERATOR
ΠŸΠ΅Ρ€Π΅Π³Π»ΡΠ΄Ρ–Π² 17 ΠΌΠ»Π½
Он ΠžΡ‚ΠΊΠ°Π·Π°Π»ΡΡ ΠΎΡ‚ Π‘Π•Π‘ΠŸΠ›ΠΠ’ΠΠžΠ™ Π²ΠΈΠ΄Π΅ΠΎΠΊΠ°Ρ€Ρ‚Ρ‹
0:40
ЖЕЛЕЗНЫЙ ΠšΠžΠ ΠžΠ›Π¬
ΠŸΠ΅Ρ€Π΅Π³Π»ΡΠ΄Ρ–Π² 1,5 ΠΌΠ»Π½
βŒΠ£Π¨Π›Π ЭПОΠ₯А!🍏
0:37
Demin's Lounge
ΠŸΠ΅Ρ€Π΅Π³Π»ΡΠ΄Ρ–Π² 301 тис.
βŒΠ£Π¨Π›Π ЭПОΠ₯А!🍏
0:37
Demin's Lounge
ΠŸΠ΅Ρ€Π΅Π³Π»ΡΠ΄Ρ–Π² 301 тис.
#bass #testing #time #magnetz #subwoofer #100w  #10" #7corr #speaker  #conation #shorts #shortvideo
0:15
SANU4YOU
ΠŸΠ΅Ρ€Π΅Π³Π»ΡΠ΄Ρ–Π² 3,1 ΠΌΠ»Π½