Brute-force solution with just easy :)
IntuitionTried to think about how get individual digit of the number and came up with "divide by 10" approachApproach
Sum digits of each number after getting th
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->
Tried to think about how get individual digit of the number and came up with "divide by 10" approach

# Approach
<!-- Describe your approach to solving the problem. -->
1. Sum digits of each number after getting them by dividing by 10(it gives us last digit of the number)
2. Find min element with the help of Math.min and spead operator

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->
Math.min is $$O(n)$$ + spead operator $$O(n)$$ + Array.map $$O(n)$$  + sumDigitsOfNum $$O(n)$$  = $$O(n)$$ 


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

# Code
```javascript []
/**
 * @param {number[]} nums
 * @return {number}
 */
var minElement = function(nums) {
    return Math.min(...nums.map(sumDigitsOfNum))
};

function sumDigitsOfNum(num){
    let sum  = 0;
    while(num>0){
        sum+=num%10;
        num = parseInt(num/10);
    }
    return sum;
}
```
['JavaScript']