Minimum Sum of Four Digit Number

Easy
Math Math Greedy Sorting

Split 4-digit num into two 2-digit numbers to minimize their sum.

Constraints

1000 ≤ num ≤ 9999

Examples

Example 1:
Input: 2932
Output: 52
Explanation: Digits: 2,3,2,9 → 22+39=52 or 23+29=52
Example 2:
Input: 4009
Output: 13
▲ Console

Install Talent Arabia

Get instant access to jobs and career tools on your device.