Given n friends playing a circular elimination game and a step size k, return the winner. Pattern focus: Queue Simulation. Simulate the circular process until one person remains.
n = number of players, k = elimination step
winner's label
Example 1:
Input:
n = 5 k = 2
Output:
3
Explanation:
After repeated eliminations, player 3 remains.
Example 2:
Input:
n = 6 k = 5
Output:
1
Explanation:
The elimination order leaves player 1 as the winner.