C++ Solution to Leetcode 1710. Maximum Units on a Truck