Skip to content

Practice Minimum Element After Replacement With Digit Sum

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

Easy#3300
LeetCode Problem

Minimum Element After Replacement With Digit Sum

Problem Statement

You are given an integer array nums. You replace each element in nums with the sum of its digits. Return the minimum element in nums after all replacements.

Source: Minimum Element After Replacement With Digit Sum on LeetCode. Use the original task for its coding environment and submissions.

Examples

# Example 1

Input
nums = [10,12,13,14]
Output
1

# Example 2

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

# Example 3

Input
nums = [999,19,199]
Output
10

Constraints

1 <= nums.length <= 100
1 <= nums[i] <= 10^4

Related LeetCode Problems

Practice more problems similar to Minimum Element After Replacement With Digit Sum.

Review your practice with PhantomCodeAI

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