[Java/C++/Python] Standard Solution
Explanation\nMod 10 and calculate digits sum.\n\n\n# Complexity\nTime O(nlog1000)\nSpace O(1)\n\n\n\nJava\njava\n    public int minElement(int[] nums) {\n      
# **Explanation**\nMod 10 and calculate digits sum.\n<br>\n\n# **Complexity**\nTime `O(nlog1000)`\nSpace `O(1)`\n\n<br>\n\n**Java**\n```java\n    public int minElement(int[] nums) {\n        int res = Integer.MAX_VALUE;\n        for (int a : nums) {\n            int cur = 0;\n            while (a > 0) {\n                cur += a % 10;\n                a /= 10;\n            }\n            res = Math.min(res, cur);\n        }\n        return res;\n    }\n```\n\n**C++**\n```cpp\n    int minElement(vector<int>& nums) {\n        int res = INT_MAX;\n        for (int a : nums) {\n            int cur = 0;\n            while (a > 0) {\n                cur += a % 10;\n                a /= 10;\n            }\n            res = min(res, cur);\n        }\n        return res;\n    }\n```\n\n**Python**\n```py\n    def minElement(self, nums: List[int]) -> int:\n        res = inf\n        for a in nums:\n            cur = 0\n            while a:\n                cur += a % 10\n                a //= 10\n            res = min(res, cur)\n        return res\n```\n**Python 1-line**\n```py\n\tdef minElement(self, A: List[int]) -> int:\n        return min(sum(map(int, str(a))) for a in A)\n```\n
[]