Simple Swift Solution
Code
![Screenshot 2025-03-27 at 12.04.15 PM.png](https://assets.leetcode.com/users/images/5466e5b0-d35d-4755-9a55-89f1497602bb_1743066274.7683833.png)


# Code
```swift []
class Solution {
    func minElement(_ nums: [Int]) -> Int {
        var result = digitsSum(nums[0])
        if nums.count == 1 { return result }
        for i in 1..<nums.count {
            result = min(result, digitsSum(nums[i]))
        }
        return result
    }
    private func digitsSum(_ num: Int) -> Int {
        var num = num, sum = 0
        while num > 0 {
            sum += num % 10
            num /= 10
        }
        return sum
    }
}
```
['Array', 'Swift']