Interview Question Asked In yahoo

Solution 1:

I have a detailed solution to this problem written up on the math.SE blog.