3515. Find if Digit Game Can Be Won
My accepted Python solution to LeetCode problem 3515, Find if Digit Game Can Be Won, running in 0ms.
- Difficulty: Easy
- Python
- Runtime 0ms
- Memory 17.3MB
- Updated
Read the problem on LeetCode View on GitHub
The problem statement is LeetCode’s and stays on their site. What follows is my accepted solution.
Python
Accepted on LeetCode — runtime 0ms, memory 17.3MB, accepted 2025-12-29.
class Solution:
def canAliceWin(self, nums: List[int]) -> bool:
single_digit_sum = sum(x for x in nums if x < 10)
double_digit_sum = sum(x for x in nums if x >= 10)
# Alice wins if she can pick a group with strictly greater sum
return single_digit_sum != double_digit_sum