Lets get our thinking caps on:
There are 2000 persons in a hall.Everyone is named in numbers such as 1 to 2000(including 1 and 2000).They are arranged in the ascending order.A gun is given to the person 1.Person 1 will shoot the one next to him and give it to the person who is surviving next to the dead person.(i.e)1 will kill 2 and give it to 3,3 will kill 4 and give it to 5,and so on.This process is repeated continuously until there are two persons left.Who are the two people left in the end? (All are Standing in a circle).
Waiting for your answers!!!! (Write a program also to generalize your solution)
1 comment:
ha.ha.ha.... !!!
asked from me In GOOGLE Interview ...!!!
mathematical induction In terms of ..
F(2N) & F(2N+1) ............!!!
Post a Comment