Back to problems

Maximum Coins Eaten

Algorithm · Google · Easy

You are given an array that lists coin quantities. On each move, you may transfer three coins. Determine the greatest total number of coins that can be eaten. Input An array coins that stores the coin counts, with 1 <= coins[i] <= 100. The array size satisfies 1 <= len(coins) <= 1000. Output Return an integer equal to the largest number of coins that can be eaten. Example The first result is 13 because the coin counts total 4 + 1 + 2 + 6. The second result is 14 because 2 +…

Checking your access…