6 lines
191 B
Python
6 lines
191 B
Python
# 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)
|