Simple java code 1 ms beats 96 % && 40 mb beats 78 %
\n# Complexity\n-\n\n# Code\n\nclass Solution {\n    public boolean isFascinating(int n) {\n        int arr[]=new int[10];\n        int temp=n;\n        while(t
\n# Complexity\n-\n![image.png](https://assets.leetcode.com/users/images/7250bc20-33eb-4a48-8c08-911ff4f39f24_1706582937.1476665.png)\n# Code\n```\nclass Solution {\n    public boolean isFascinating(int n) {\n        int arr[]=new int[10];\n        int temp=n;\n        while(temp>0){\n            arr[temp%10]++;\n            temp=temp/10;\n        }\n        temp=2*n;\n        while(temp>0){\n            arr[temp%10]++;\n            temp=temp/10;\n        }\n        temp=3*n;\n        while(temp>0){\n            arr[temp%10]++;\n            temp=temp/10;\n        }\n        if(arr[0]>0){\n            return false;\n        }\n        for(int i=1;i<10;i++){\n            if(arr[i]!=1){\n                return false;\n            }\n        }\n        return true;\n    }\n}\n```
['Math', 'Java']