Python code to check if the number is fascinating (TC&SC: O(log(n)))
\n# Complexity\n- Time complexity:\nO(log(n))\n\n- Space complexity:\nO(log(n))\n\n# Code\n\nclass Solution:\n    def isFascinating(self, n: int) -> bool:\n    
\n# Complexity\n- Time complexity:\nO(log(n))\n\n- Space complexity:\nO(log(n))\n\n# Code\n```\nclass Solution:\n    def isFascinating(self, n: int) -> bool:\n        count = 0\n        z = str(n)+str(2*n)+str(3*n)\n        for i in range(1,10):\n            if str(i) in z:\n                count = count+1\n        if count == len(z):\n            return True\n```
['Python', 'Python3']