Skip to content

Practice Find if Digit Game Can Be Won

Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.

Easy#3232
LeetCode Problem

Find if Digit Game Can Be Won

Problem Statement

You are given an array of positive integers nums. Alice and Bob are playing a game. In the game, Alice can choose either all single-digit numbers or all double-digit numbers from nums, and the rest of the numbers are given to Bob. Alice wins if the sum of her numbers is strictly greater than the sum of Bob's numbers. Return true if Alice can win this game, otherwise, return false.

Source: Find if Digit Game Can Be Won on LeetCode. Use the original task for its coding environment and submissions.

Examples

# Example 1

Input
nums = [1,2,3,4,10]
Output
false

# Example 2

Input
nums = [1,2,3,4,5,14]
Output
true

# Example 3

Input
nums = [5,5,5,25]
Output
true

Constraints

1 <= nums.length <= 100
1 <= nums[i] <= 99

Related LeetCode Problems

Practice more problems similar to Find if Digit Game Can Be Won.

Review your practice with PhantomCodeAI

After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.