josephus
Calculate the survivor’s position in a circle of n people where every k-th person is eliminated, solving the Josephus problem for given n and k.
Instructions
Solve the Josephus problem: find the survivor in a circle of n people eliminating every k-th.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| k | Yes | Every k-th person is eliminated | |
| n | Yes | Number of people in the circle |