Simple Java Solution || Beats 100% || Beginner friendly
IntutionApproachComplexity
Time complexity: O(n)

Space complexity: O(1)
Code
# Intution
<!-- Describe your first thoughts on how to solve this problem. -->

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

# Complexity
- Time complexity: O(n)
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity: O(1)
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```java []
class Solution {
    public int minElement(int[] nums) {
        int res=Integer.MAX_VALUE;
    for(int i=0;i<nums.length;i++){
        int sum=0;
        while(nums[i]>0){
            int rem=nums[i]%10;
            sum+=rem;
            nums[i]/=10;
        }
        res=(sum<res)?sum:res;
    } return res;   
    }
}
```
['Java']