2025-09-08 15:09:53 +0000 UTC

Convert Integer to the Sum of Two No-Zero Integers

Code

class Solution:
    def getNoZeroIntegers(self, n: int) -> List[int]:
        for A in range(1, n):
            B = n - A
            if "0" not in str(A) + str(B):
                return [A, B]
        return []