Take Gifts From the Richest Pile | Leetcode 2558