K 10 output.
2 eggs highest floor.
You are given two eggs and access to a 100 storey building.
One floor at a time.
And you need to find it in a way suc.
So let s say the first egg breaks on 27 after 2 drops.
However once an egg is broken it cannot be used anymore.
We must now narrow it from floor 78 83 which could take from 1 to 6 drops.
Eggs can be very hard or very fragile means it may break if dropped from the first floor or may not even break if dropped from 100 th floor both eggs are identical.
A building has 100 floors.
You need to figure out the highest floor of a 100 storey building an egg can be dropped without breaking.
There s no other one egg solution.
If an egg is dropped and does not break it is undamaged and can be dropped again.
Let s talk about the 2 egg problem courtesy of interview cake.
We then have to narrow it from floor 15 26 with the second egg which could take from 1 to 12 drops.
2 eggs 100 floors.
Two cases arise 1 if egg breaks we have one egg left so we need three more trials.
4 we first try from 4 th floor.
One of the floors is the highest floor an egg can be dropped from without breaking.
Both eggs are identical.
For example if it breaks on floor 57 we know that the highest floor that an egg can withstand a drop from is floor 56.
If it survives great we go up to floor 2 and try again then floor 3 all the way up the building.
The aim is to find out the highest floor from which an egg will not break when dropped from a floor.
This problem is a specific case of n eggs and k floors.
You are given 2 eggs and you are in a building with 100 floors.
Eventually the egg will break and we ll have a solution.
Making a maximum of 14.
You need to find the minimum floor where the egg breaks.
You are given 2 eggs.
Now consider if the first egg breaks on the 8th drop at floor 84.