Yahoo Interview Question
Software Engineer / DevelopersSince the apple is a circle of radius 31mm, the diameter which divides the circle in 2 equal parts through the center would be equal to 62 mm. The tunnel made by the worm is 61mm long. Irrespective of the orientation of the tunnel, it would never be spread across 2 halves (crossing the center) and can be enclosed in 1 half, where the other half would not be rotten.
Prove? Algorithm?
- Anonymous September 13, 2010