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