100 people are standing in a circle. The person standing at number 1 is having a sword. He kills the person next to him with the sword and then gives the sword to the third person. This process is carried out till there is just one person left. Which number survives at the last?
73rd person will survive at last. If the number of players is the power of 2, the last person to survive will be the one who started it. But since the number here is not the power of 2, we will take the greatest power of 2 that is less than the number of players (100) which is 64. So when starting with 100 players - we need to kill 36 of them to get down to a power of 2 (64). Since we kill every other person starting at player 2 the last person we need to die is player 72, they will be killed by player 71 and the first person in the effective power of 2 game, who will win is player 73. It's worth noting that this process of reducing to a power of 2 will always be completed in the first round regardless of the number of players. Consider X players, let Y be the highest power of 2 that is less than or equal to Y The winning player is 2 * (X - Y) + 1