bumpsoo 2024-07-06 19:27:02 +09:00
parent ff8ee6aed4
commit bd4d2f7f46

6
easy/pass_the_pillow.py Normal file
View file

@ -0,0 +1,6 @@
# https://leetcode.com/problems/pass-the-pillow
class Solution:
def passThePillow(self, n: int, time: int) -> int:
pos = time % (2 * (n - 1))
return n - abs(n - 1 - pos)