Beat 100%💯 || EASY TO UNDERSTAND💯🔥✅
\n# Code\njava []\nimport java.util.Arrays;\nclass Solution {\n    public int minElement(int[] nums) {\n        int n= nums.length;\n        int[] ans = new int
\n# Code\n```java []\nimport java.util.Arrays;\nclass Solution {\n    public int minElement(int[] nums) {\n        int n= nums.length;\n        int[] ans = new int[n];\n        for(int i=0;i<n;i++){\n            int sum=0;\n            while(nums[i]>0){\n               int x=nums[i]%10;\n               sum+=x;\n               nums[i]/=10;\n            }\n            ans[i]=sum;\n        }\n        return Arrays.stream(ans).min().getAsInt();\n    }\n}\n```
['Java']