Convert Integer to the Sum of Two No-Zero Integers Problem
Convert Integer to the Sum of Two No-Zero Integers Problem — ExecCode Easy DSA Practice
Solve the Convert Integer to the Sum of Two No-Zero Integers problem on ExecCode. Free online easy DSA practice in Math. Write and run code in Java, C++, Python — no signup required to run.
Problem description
Description You are given an integer n, return a list of two integers [a, b] where:. Your task is to if there are many valid solutions, you can return any of them. No-Zero integer is a positive integer that does not contain any 0 in its decimal representation. - a and b are No-Zero integers. - a + b = n The test cases are generated so that there is at least one valid solution.
Examples
Input {"n": 2}; Output [1, 1]. Input {"n": 11}; Output [2, 9]
Constraints
2 <= n <= 10^4
Practice Convert Integer to the Sum of Two No-Zero Integers free on ExecCode. Browse DSA problems, topic map, and placement guides.