Video Solution || Accepted✅✅
Intuition\n Describe your first thoughts on how to solve this problem. \nsorting will be the hero\n\n# Approach\n Describe your approach to solving the problem.
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nsorting will be the hero\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n1) fimd the actual number after computation in string form\n2) sort the string\n3) check the duplicate or zero value \n\nclick to see the video solution\n[click me](https://youtu.be/-mx_Q4tdVRI)\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n$$O(nlogn)$$\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n$$O(1)$$\n\n# Code\n```\nclass Solution {\npublic:\n    bool isFascinating(int n) {\n        int m = 2*n;\n        int p = 3*n;\n        string a = to_string(n);\n        string b = to_string(m);\n        string c = to_string(p);\n        string ans  = a+b+c;\n        sort(ans.begin(), ans.end());\n        bool flag = 0;\n        int num = ans.size();\n        for(int i=0;i<num-1;i++){\n             if(ans[i]==\'0\'){\n                flag = 1;\n                break;\n            }\n            if(ans[i]==ans[i+ 1]){\n                flag = 1;\n                break;\n            }\n        }\n        if(flag == 1){\n            return false;\n        }\n        else{\n            return true;\n        }\n        \n        \n            \n        \n    }\n};\n```
['C++']