When, there is a case like,
floor=1 and egg=2
So, what will be the minimum attempts require to find the critical point?
When, there is a case like,
floor=1 and egg=2
So, what will be the minimum attempts require to find the critical point?
hello @Kinjal
if there is only one floor bro.
then one attempt is enough to comment whether it will break from first floor or not.
What I want to know is the mathematical equation to get the value of dp[2][1]=1…
What I’m thinking is like,
dp[2][1]=1 + max(0,0) =1
where dp[egg][floor]
Explanation: floor 1 hai so add 1 initially to include the floor and place the egg in that floor,
dp[2][1]=1+ …Now,
if egg breaks then there is a critical point less than that floor which will be dp[0][0]=0 (0 floor with 0 eggs)
if egg doesn’t breaks then there will be no critical points because there is no floor left to attempt so it will become 0.
dp[2][1]=1+max(0,0) = 1
Is that a right explanation?
yeah . . . . . . . . .
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.
Bhaiya, feedback de diye hai.