2160. Minimum Sum of Four Digit Number After Splitting Digits
On This Page
class Solution:
def minimumSum(self, num: int) -> int:
nums = []
while num:
nums.append(num % 10)
num //= 10
nums.sort()
return 10 * (nums[0] + nums[1]) + nums[2] + nums[3]