Python Elegant & Short | Counter
Complexity\n- Time complexity: O(n)\n- Space complexity: O(n)\n\n\n# Code\n\nclass Solution:\n    DIGITS = Counter(\'123456789\')\n\n    def isFascinating(self,
# Complexity\n- Time complexity: $$O(n)$$\n- Space complexity: $$O(n)$$\n\n\n# Code\n```\nclass Solution:\n    DIGITS = Counter(\'123456789\')\n\n    def isFascinating(self, n: int) -> bool:\n        return Counter(str(n) + str(2 * n) + str(3 * n)) == self.DIGITS\n\n```
['Hash Table', 'Python', 'Python3']