98% faster Js solution with Array.filter()
Intuition\n\n Describe your first thoughts on how to solve this problem. \n> # Upvote it if you find it usefull\n# Approach\n Describe your approach to solving 
# Intuition\n![Screenshot from 2023-03-30 20-04-22.png](https://assets.leetcode.com/users/images/23db5bfb-648c-4194-a79d-32922638b196_1680188761.0945294.png)\n<!-- Describe your first thoughts on how to solve this problem. -->\n> # *Upvote it if you find it usefull*\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 */\nvar digitCount = function(num) {\n    for(let  i=0;i<num.length ; i++ ){\n     let  occ = num.split(\'\').filter(e=>e==i).length;\n     if(num[i] !=occ)return false;\n    }\n    return true;\n};\n```
['JavaScript']