[LeetCode] 2558. Take Gifts From the Richest Pile (Python)
·
알고리즘/LeetCode
난이도: Easy 문제 설명You are given an integer array gifts denoting the number of gifts in various piles. Every second, you do the following:Choose the pile with the maximum number of gifts.If there is more than one pile with the maximum number of gifts, choose any.Leave behind the floor of the square root of the number of gifts in the pile. Take the rest of the gifts.Return the number of gifts remaini..