Easy and Simple C++ using Strings.
IntuitionThis is a easy problem you just have to change the type of data structure. That's it for thisApproach
First Calculate the Multiplication with 2 and 3 a
# Intuition
This is a easy problem you just have to change the type of data structure. That's it for this

# Approach
- First Calculate the Multiplication with 2 and 3 and store them.
- Then Convert these into String Using the to_String() function.
- Then declare 2 string one is empty and other with number from 1 to 9.
- Sort the answer string and just compare the 2 strings with each other and break the loop if at some index the values are mismatched



# Code
```cpp []
class Solution {
public:
    bool isFascinating(int n) {
        int a = 2 * n;
        int b = 3 * n;

        string alen = to_string(a);
        string blen = to_string(b);
        string nlen = to_string(n);

        string res = alen + blen + nlen;
        string exp = "123456789";
        sort(res.begin(), res.end());

        for (int i = 0; i <= res.length(); i++) {

            if (res[i] != exp[i]) {
                return false;
                break;
            }
        }

        return true;
        
    }
};
```
['C++']