Convert Integer to the Sum of Two No-Zero Integers - Problem
A No-Zero integer is a positive integer that does not contain any 0 in its decimal representation.
Given an integer n, return a list of two integers [a, b] where:
aandbare No-Zero integersa + b = n
The test cases are generated so that there is at least one valid solution. If there are many valid solutions, you can return any of them.
Input & Output
Example 1 — Basic Case
$
Input:
n = 2
›
Output:
[1,1]
💡 Note:
1 + 1 = 2. Both 1 and 1 are no-zero integers (contain no digit 0)
Example 2 — Larger Number
$
Input:
n = 11
›
Output:
[2,9]
💡 Note:
2 + 9 = 11. Both 2 and 9 contain no zeros. Note: [1,10] would be invalid since 10 contains 0
Example 3 — Three Digit Number
$
Input:
n = 101
›
Output:
[2,99]
💡 Note:
2 + 99 = 101. Both 2 and 99 contain no zeros. Note: [1,100] would be invalid since 100 contains 0
Constraints
- 2 ≤ n ≤ 104
Visualization
Tap to expand
💡
Explanation
AI Ready
💡 Suggestion
Tab
to accept
Esc
to dismiss
// Output will appear here after running code