Max of 14 drops required

Consider the floor from which egg needs to be dropped as F

F = 0, x =14

do
{
F = F + x
drop first egg from floor F
x--
}while(first egg doesnt break);

F = F - x-1;

do
{
F++
drop second egg from floor F
}while(second egg doesnt break);

return F


On Jul 6, 10:05 pm, shiv narayan <narayan.shiv...@gmail.com> wrote:
> * You are given 2 eggs.
> * You have access to a 100-storey building.
> * 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 need to figure out the highest floor of a 100-storey building an
> egg can be
> dropped without breaking.
> * Now the question is how many drops you need to make. You are allowed
> to break 2
> eggs in the process

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to