Best approach
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\n/**\n * @param {string} num\n * @return {boolean}\n */\nconst digitCount = function (num) {\n\n    const arr = num.split("");\n\n    for (let i = 0; i < arr.length; i++) {\n        let count = arr.filter((e) => i == e).length;\n\n        if (Number(arr[i]) !== count) {\n            return false;\n        }\n    }\n    return true;\n    \n};\n```
['JavaScript']