1 class Solution: 2 def isNonZeroNum(self,m): 3 s = str(m) 4 for i in range(len(s)): 5 if s[i] == '0': 6 return False 7 return True 8 9 def getNoZeroIntegers(self, n: int) -> 'List[int]': 10 for i in range(1,n): 11 A,B = i,n-i 12 if self.isNonZeroNum(A) and self.isNonZeroNum(B): 13 return [A,B] 14 return []
遍历[1,n-1],判断每组数字是否都不含0。