1561. Maximum Number of Coins You Can Get

Updated: 2024-03-12
1 min read
[]

On This Page

LeetCode problem 1561

class Solution:
    def maxCoins(self, piles: List[int]) -> int:
        piles.sort()
        return sum(piles[-2 : len(piles) // 3 - 1 : -2])