Power of JavaScript using String Interpolation and Sorting
Complexity\n- Time complexity: O(Nlog(N))\n Add your time complexity here, e.g. O(n) \n\n- Space complexity: O(1)\n Add your space complexity here, e.g. O(n) \n
# Complexity\n- Time complexity: O(Nlog(N))\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nfunction isFascinating(n: number): boolean {\n    let allNumbers = \'123456789\'\n    let fancyNumber = `${n}${n * 2}${n * 3}`.split("").sort().join("")\n    if(allNumbers == fancyNumber){\n        return true\n    }\n    return false\n};\n```
['Math', 'Sorting', 'TypeScript', 'JavaScript']