Re: Solve this equation for me
This is basically binary search >_>
Drop the glass ball from the 50th floor.. if it breaks, try to drop the ball from 25th, 13th, 7th, ...
If it doesn't break from 50th floor, try to drop it from 75th floor, etc
Maximum of ceil(log_2(100)) = 7 drops are needed
This is basically binary search >_>
Drop the glass ball from the 50th floor.. if it breaks, try to drop the ball from 25th, 13th, 7th, ...
If it doesn't break from 50th floor, try to drop it from 75th floor, etc
Maximum of ceil(log_2(100)) = 7 drops are needed






Comment