classSolution:defselfDividingNumbers(self, left:int, right:int)-> List[int]:
res =[]for num inrange(left,right+1):
temp = num
while temp:# 各个位上的数不能为非法除数0,并且么每次除最右边的数判断是否为0if temp%10==0or num %(temp%10)!=0:break
temp //=10else:
res.append(num)return res