Tap here to switch tabs
Problem
Submissions

Problem: Difference Between Element Sum and Digit Sum of Array

Try to solve the Difference Between Element Sum and Digit Sum of an Array problem.

Statement

You are given an array of positive integers nums.

The element sum is the sum of all elements in nums.
The digit sum is the sum of every digit that appears in nums.

Return the absolute difference between the element sum and the digit sum of nums.

Constraints:

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

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

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Difference Between Element Sum and Digit Sum of Array

Try to solve the Difference Between Element Sum and Digit Sum of an Array problem.

Statement

You are given an array of positive integers nums.

The element sum is the sum of all elements in nums.
The digit sum is the sum of every digit that appears in nums.

Return the absolute difference between the element sum and the digit sum of nums.

Constraints:

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

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