# 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)