Count digits as we go
Intuition\n Output should not have a 0\n Count digits as we make 2x and 3x of n, and look for dupes as we go\n\n# Approach\n Use an array as our map, much faste
# Intuition\n* Output should not have a `0`\n* Count digits as we make 2x and 3x of n, and look for dupes as we go\n\n# Approach\n* Use an array as our map, much faster than a `map`\n* Look for `0`s\n* Count digits and look for dupes as we go\n\n# Complexity\n- Time complexity:\n$$O(n)$$\n\n- Space complexity:\n$$O(n)$$\n\n# Code\n```\nfunc isFascinating(n int) bool {\n\tm := [9]bool{}\n\n\tfor i, curr := 1, n; i <= 3; i, curr = i+1, n*(i+1) {\n\t\tfor curr > 0 {\n\t\t\td := curr % 10\n\t\t\tif d == 0 {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tcurr /= 10\n\t\t\tif m[d-1] {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tm[d-1] = true\n\t\t}\n\t}\n\treturn true\n}\n```\n\n##### Using an array vs map to look for dupes:\n\n```\nBenchmark_isFascinatingMap\nBenchmark_isFascinatingMap-8   \t 3680568\t       297.1 ns/op\nBenchmark_isFascinating\nBenchmark_isFascinating-8      \t57233817\t        21.02 ns/op\n```
['Go']