Closed PrakharRathore123 closed 2 years ago
@SarthakKeshari Kindly acknowledge this I have submitted this in dynamic programming folder.
@SarthakKeshari 2 outputs as shown in images with Test case 1-Number egg are 2 and Number of Floors are 10 so when we throw egg it two possibility it beaks and it doesn't break .If it break then number of egg will be 1 less and we have check for floor -1 (floor where first egg breaks).Because we have to find the threshold floor and we have stop when number of egg is 1 . Test case 2-If number of eggs is 1 then we have to return the number of floor because we have return the worst case.
@SarthakKeshari Kindly check
Issue Id you have worked upon -
382
Briefly explain your program logic -
1)If Number of floor is 1 or 0 then return number of floor 2)If the number of egg is 1 then return number of floors 3)If egg breaks then floor will k-1 and egg will be n-1 4)Else floor will be k-i and number of eggs will be same
Test case 1-Number egg are 2 and Number of Floors are 10 so when we throw egg it two possibility it beaks and it doesn't break .If it break then number of egg will be 1 less and we have check for floor -1 (floor where first egg breaks).Because we have to find the threshold floor and we have stop when number of egg is 1 . Test case 2-If number of eggs is 1 then we have to return the number of floor because we have return the worst case.
Screenshots(Attach 2 screenshots of your own input and output) -
Attach here
Checklist:
Eg - If your code follow the below guidelines. Kindly change [] to [x]
All the conditions should be fulfilled for considering your code for merging -
[x] I have mentioned the question as comment in my solution file.
[x] My code follows the guidelines of this project.
[x] I have performed a self-review of my own code.
[x] I have commented my code.
[x] My code gives the correct output.
[x] I confirm that I have not copied the code from anywhere. In case its found that I have copied even after successful merge then I can be banned from the repository and hacktoberfest.
[x] I affirm that I strictly follow contributing guidelines and code of conduct.