JAVA | Simple solution | No String | 100% Faster
Complexity\n- Time complexity: O(log(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(log(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```\nclass Solution {\n\n    public boolean isFascinating(int n) {\n        boolean[] facinatingDigits = new boolean[10];\n        int n2 = 2 * n;\n        int n3 = 3 * n;\n        while (n > 0) {\n            facinatingDigits[n % 10] = true;\n            facinatingDigits[n2 % 10] = true;\n            facinatingDigits[n3 % 10] = true;\n            n /= 10;\n            n2 /= 10;\n            n3 /= 10;\n        }\n        for (int i = 1; i < facinatingDigits.length; i++) {\n            if (!facinatingDigits[i]) {\n                return false;\n            }\n        }\n\n        return true;\n    }\n}\n```
['Math', 'Java']