Bin Packing Problem Leetcode Python