Tap here to switch tabs
Problem
Submissions

Problem: Minimum Element After Replacement With Digit Sum

med
30 min
Try to solve the Minimum Element After Replacement With Digit Sum problem.

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

med
30 min
Try to solve the Minimum Element After Replacement With Digit Sum problem.

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