100 people standing in a circle in an order 1 to 100. No. 1 has a sword. He kills the next person (i.e. No. 2) and gives the sword to the next (i.e. No. 3). All people do the same until only 1 survives. Which number survives at the last? 🤔 Remember, they are in a circle. This will take some time, so don't worry about fastest finger first!
- Manage state of Alive vs Dead in Node
- Simulate circular linked list using list
- Iterations using
for
loops and the Sword moves []rune
becausestring
mutation is not allowed