Amazon Robotics Interview Question

Leetcode style question about fitting packages into spaces