time by 2 * (n - 1).time with 2 * (n - 1).n, the pillow is being passed in the forward direction. The position of the pillow is the same as the remaining time.n, the pillow is being passed in the reverse direction. The position of the pillow is 2 * n - remaining time - 1.