Tap here to switch tabs
Problem
Submissions

Problem: Minimum Element After Replacement With Digit Sum

Minimum Element After Replacement With Digit Sum asks you to replace every integer in an array with its digit sum, then return the smallest resulting value.

Statement

You are given an integer array nums.

Replace each element in nums with the sum of its digits.

Return the minimum element in nums after performing the replacement on all elements.

Constraints:

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

  • 1≤1 \leq nums[i] ≤104\leq 10^4

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Minimum Element After Replacement With Digit Sum

Minimum Element After Replacement With Digit Sum asks you to replace every integer in an array with its digit sum, then return the smallest resulting value.

Statement

You are given an integer array nums.

Replace each element in nums with the sum of its digits.

Return the minimum element in nums after performing the replacement on all elements.

Constraints:

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

  • 1≤1 \leq nums[i] ≤104\leq 10^4