We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 24689eb commit 2a76b71Copy full SHA for 2a76b71
2582-pass-the-pillow/2582-pass-the-pillow.py
@@ -0,0 +1,8 @@
1
+class Solution:
2
+ def passThePillow(self, n: int, time: int) -> int:
3
+ full_rounds=time//(n-1)
4
+ extra_time=time%(n-1)
5
+ if full_rounds%2==0:
6
+ return extra_time+1
7
+ else:
8
+ return n-extra_time
0 commit comments