Simple Brute force Approach .
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(nlogn)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(n)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```java []\nclass Solution {\n    public int minElement(int[] nums) {\n        int n = nums.length;\n        for(int i=0; i<n; i++){\n            int rep = nums[i];\n            nums[i] = digitsum(rep);\n        }\n        Arrays.sort(nums);\n        return nums[0];\n    }\n    public static int digitsum(int num){\n        int sum = 0;\n        while(num != 0){\n            int res = num % 10;\n            sum += res;\n            num /= 10;\n        }\n        return sum;\n    }\n}\n```
['Array', 'Java']