A group of children form a ring. The first child is selected and they start counting clockwise from that child until a fixed number (n, which is given at the starting of the game) is reached. When the count reaches n, the child on the nth spot is eliminated. The game continues again starting with the next child and the process continues until a single child remains.Your aim is to print the position of the child which remains till last.
For example, if there are 10 children and the fixed number n is 6, the position of the last child who remains till the last is 3.
Is there a better programmatic algorithm for solving this problem?
P.S. I know that we can easily do this using arrays or other data structures. I just want the best strategy, preferably a mathematical approach.