← All problemsSign in

1561. Maximum Number of Coins You Can Get

LeetCodeArrayMathGreedySortingGame TheoryOpen on judge ↗

There are 3n piles of coins of varying size, you and your friends will take piles of coins as follows: - In each step, you will choose any 3 piles of coins (not necessarily consecutive). - Of your choice, Alice will pick the pile with the maximum number of coins. - You will pick the next pile with the maximum number of coins. - Your friend Bob will pick the last pile. - Repeat until there are

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start