Tap here to switch tabs
Problem
Submissions

Problem: Find if Digit Game Can Be Won

med
30 min
Try to solve the Find if Digit Game Can Be Won problem.

Statement

You are given an array of positive integers nums.

Alice and Bob play a game where Alice can choose to collect either all single digit numbers or all double digit numbers from nums. Bob receives all the remaining numbers.

Alice wins if the sum of her chosen numbers is strictly greater than the sum of Bob’s numbers.

Return true if Alice can win the game, or false otherwise.

Constraints:

  • 1≤1 \leq nums.length ≤100\leq 100

  • 1≤1 \leq nums[i] ≤99\leq 99

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Find if Digit Game Can Be Won

med
30 min
Try to solve the Find if Digit Game Can Be Won problem.

Statement

You are given an array of positive integers nums.

Alice and Bob play a game where Alice can choose to collect either all single digit numbers or all double digit numbers from nums. Bob receives all the remaining numbers.

Alice wins if the sum of her chosen numbers is strictly greater than the sum of Bob’s numbers.

Return true if Alice can win the game, or false otherwise.

Constraints:

  • 1≤1 \leq nums.length ≤100\leq 100

  • 1≤1 \leq nums[i] ≤99\leq 99