LeetCode 6348. Take Gifts From the Richest Pile