1823. Find the Winner of the Circular Game
On This Page
class Solution:
def findTheWinner(self, n: int, k: int) -> int:
if n == 1:
return 1
res = (k + self.findTheWinner(n - 1, k)) % n
return n if res == 0 else res