This commit is contained in:
parent
ff8ee6aed4
commit
bd4d2f7f46
1 changed files with 6 additions and 0 deletions
6
easy/pass_the_pillow.py
Normal file
6
easy/pass_the_pillow.py
Normal 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)
|
||||||
Loading…
Add table
Add a link
Reference in a new issue