Easy Java Solution || 1ms
IntuitionApproachComplexity

Time complexity:
O(n)


Space complexity:
O(1)

Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
O(n)

- Space complexity:
O(1)

# Code
```java []
class Solution {
    public int minElement(int[] nums) {
        int minVal=Integer.MAX_VALUE;
        for(int i=0;i<nums.length;i++){
            nums[i]=digitSum(nums[i]);
            minVal=Math.min(minVal,nums[i]);
        }
        return minVal;
    }
    public static int digitSum(int num){
        int sum=0;
        while(num>0){
            sum+=num%10;
            num/=10;
        }
        return sum;
    }
}
```
['Java']