Maximum Candies You Can Get from Boxes | Leetcode 1298