Check if The Number is Fascinating
IntuitionThe key observation is that a fascinating number, when concatenated with its multiples 2n and 3n, must contain each of the digits 1 through 9 exactly o
![i1.png](https://assets.leetcode.com/users/images/ee0270db-f6f6-4cf6-8a5b-8c39232ec7d7_1744352654.3690531.png)


# Intuition
The key observation is that a fascinating number, when concatenated with its multiples 2n and 3n, must contain each of the digits 1 through 9 exactly once. By concatenating these values and then sorting the resulting string, we can verify if it equals "123456789".

# Approach
**1. Concatenation:** Convert the number n, 2n, and 3n into strings and concatenate them.
**2. Sorting:** Sort the concatenated string.
**3. Verification:** Compare the sorted result with "123456789". If they match, then the number is fascinating; otherwise, it is not.

# Complexity
- Time complexity: O(1)

- Space complexity: O(1)

# Code
```python3 []
class Solution:
    def isFascinating(self, n: int) -> bool:
        num = str(n) + str(2 * n) + str(3 * n)
        return "".join(sorted(num)) == "123456789"
```
['Math', 'Python3']