✔️ Simple Python and Java Solution with Example for Easy Understanding
STEPS DONE:\n\n- Sort\n- Pick least possible tens which will be first two and pair with remaining numbers for digits place which will be last two\n\nHavn\'t Und
### STEPS DONE:\n\n- Sort\n- Pick least possible tens which will be first two and pair with remaining numbers for digits place which will be last two\n\nHavn\'t Understood !!\n\n### Examples \nIf we have 8759 as a four digit number\n\nTo make a smaller sum we will obviously need smaller numbers\nHence to make the smaller numbers break them into individual digits and sort the numbers\n\nafter sorting we have [5, 7, 8, 9]\nthen we pick a least possible for tens position and max possible for ones position\nlike 5 and 7 for tens position and 9 and 8 for unit digits position\nyou can also pick 5 and 8 and 7 and 9 it doesnt matter as long as your tens digits are least from array\n\n59 + 78 = 137\nThis will be the answer\n\nAnother Example : 4009\nafter sorting [0, 0, 4, 9]\nafter picking 09 + 04 OR 04 + 09  both equals 13\n\nAnother Example : 2932\nafter sorting [2, 2, 3, 9]\nafter picking 29 +23 OR 23 +29 both equals 52\n\nAnother Example : 2675\nafter sorting [2, 5, 6, 7]\nafter picking 27 + 56 OR 57+26  both equals 83\n\n\n### Python Method 1\n\n```python\n\nclass Solution(object):\n    \n    # TC : O(N)\n    # SC : O(N)\n    def minimumSum(self, num):\n        """\n        :type num: int\n        :rtype: int\n        """        \n        a = sorted([i for i in str(num)])\n        num1 = a[0]+a[3]\n        num2 = a[1]+a[2]\n                \n        return int(num1)+int(num2)  \n```\n### Python Method 2\n\n```python\n\nclass Solution(object):\n    \n    # TC : O(N)\n    # SC : O(N)\n    def minimumSum(self, num):\n        """\n        :type num: int\n        :rtype: int\n        """\n        arr=[]\n        \n        while num:\n            arr.append(num%10)\n            num//=10\n        return (arr[0]*10+arr[3]) + (arr[1]*10+arr[2])\n```\n        \n### Java\n\n```java\nclass Solution {\n    public int minimumSum(int num) {\n\n        int i = 0;\n        int[] arr = new int[4];\n\n        while (num > 0) {\n            arr[i] = num % 10;\n            num = num / 10;\n            i++;\n        }\n\n        Arrays.sort(arr);\n        return arr[0]*10 + arr[3] + arr[1]*10 +arr[2]; \n    }\n}\n```
['Python', 'Java']