Box Stacking Problem Leetcode