Skip to content

Commit 2a76b71

Browse files
committed
Time: 30 ms (83.54%), Space: 16.6 MB (30.38%) - LeetHub
1 parent 24689eb commit 2a76b71

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)