JAVA EASY SOLUTION || 100% BEATS || Greedy on Sum
Approach\n Describe your approach to solving the problem. \nBy greedy on minimum sum,produce a number using first and third element and another element is forme
# Approach\n<!-- Describe your approach to solving the problem. -->\nBy greedy on minimum sum,produce a number using first and third element and another element is formed with second and third element.Return the sum of produced elements.\n\n# Complexity\n- Time complexity: $$O(1)$$ , yet it uses only constant running time.\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: $$O(1)$$ , yet it uses only constant auxilary space.\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    public int minimumSum(int num) {\n        ArrayList<Integer> list = new ArrayList<>();\n        int t = num ;\n        while(t>0){\n            list.add(t%10);\n            t/=10;\n        }\n        Collections.sort(list);\n        int first = list.get(0)*10+list.get(2);\n        int second = list.get(1)*10+list.get(3);\n        return first+second;\n    }\n}\n```
['Greedy', 'Number Theory', 'Java']