LeetCode solutions

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

Read the problem on LeetCode View on GitHub

Python

Accepted on LeetCode — runtime 0ms, memory 17.3MB, accepted 2025-12-29.

python
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

Source