ATA-challenge-circle
Solution to a challenge for a thinking ape from the vanhackthon event.
Challenge: Imagine you have a circle of people and you go around the circle removing every second person until one person is left.
If you have 3 people in the circle, then the 3rd person will be the last one remaining. If you have 4 people then the 1st person will be the last one remaining. If you have 11 people then the 7th person will be the one remaining.
If you have N people in the circle, who will be the last one remaining?
Please formulate your answer as a general solution and not as an algorithm that simulates the problem.
Solution made by induction.
Built With
- txt
Log in or sign up for Devpost to join the conversation.