Brute Force - Python
Please check out LeetCode The Hard Way for more solution explanations and tutorials. If you like it, please give a star and watch my Github Repository. We also 
Please check out LeetCode The Hard Way for more solution explanations and tutorials. If you like it, please give a star and watch my Github Repository. We also have a Discord server for daily problem discussion. Link in bio.\n\n---\n\nFor each element, we calculate the digit sum and use $res$ to keep track of the minimum one.\n\n```py\nclass Solution:\n    def minElement(self, nums: List[int]) -> int:\n        res = 10 ** 9\n        for x in nums:\n            s = 0\n            while x > 0:\n                s += x % 10\n                x //= 10\n            res = min(res, s)\n        return res\n```
['Python3']