Find the Winner of the Circular Game LeetCode solution in Python

1
class Solution:
2
def findTheWinner(self, n, k):
3
ls = list(range(1, n + 1))
4
while len(ls) > 1:
5
i = (k - 1) % len(ls)
6
ls.pop(i)
7
ls = ls[i:] + ls[:i]
8

9
return ls[0]

0

WPM •0 •0

100%

ACC •0 •0

0s

TIME •0