Rotating the Box | Leetcode 1861