bumpsoo 2024-07-08 21:44:08 +09:00
parent 94c61a1f83
commit 658f8674ca

View file

@ -0,0 +1,8 @@
# https://leetcode.com/problems/find-the-winner-of-the-circular-game
class Solution:
def findTheWinner(self, n: int, k: int) -> int:
result = 1
for i in range(2, n + 1):
result = (result + k - 1) % i + 1
return result