Skip to content

Latest commit

 

History

History
23 lines (14 loc) · 401 Bytes

728.md

File metadata and controls

23 lines (14 loc) · 401 Bytes

Self Dividing Numbers

Description

link


Solution

  • See Code

Code

O(n)

class Solution:
    def selfDividingNumbers(self, left: int, right: int) -> List[int]:
        return [num for num in range(left, right + 1) if not any([digit == '0' or num % int(digit) != 0 for digit in str(num)])]