Easy cpp solution || 100% Fast
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:O(32*N)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:O(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```cpp []\nclass Solution {\n    int digitSum(int n){\n        string s= to_string(n);\n        int sum=0;\n        for(auto it:s){\n            sum+=(it-\'0\');\n        }\n        return sum;\n    }\npublic:\n    int minElement(vector<int>& nums) {\n        int ans =1e9;\n\n        for(auto it: nums){\n            ans = min(ans, digitSum(it));\n        }\n        return ans;\n        \n    }\n};\n```
['C++']