cards are laid out on a table. Two people play: the first player picks **one** of two piles, either all the one-digit cards or all the two-digit cards, and the second player gets every other card.
The first player wins if the sum of their cards is strictly greater than the opponent's.
Return True if the first player can pick a pile that wins, and False otherwise.cards=[7, 8, 12, 3] → True
The one-digit cards add up to 7 + 8 + 3 = 18 and the two-digit ones to 12. Taking the one-digit cards gives 18 against 12, a win.
cards=[6, 4, 10] → False
Both piles add up to 10, so either choice ends in a tie, and a tie is not a win.
cards=[45] → True
There are no one-digit cards. The first player takes the two-digit ones: 45 against 0.
cards=[7, 8, 12, 3]
True
Run checks the first 3 tests in your browser. Submit checks all 118 tests on the server, hidden ones included.