Simple easy cpp solution beats 100% ✅✅
\n\n# Code\n\nclass Solution {\npublic:\n    bool digitCount(string num) {\n        unordered_map<int,int> m;\n        for(auto x : num){\n            m[x-\'0\'
\n\n# Code\n```\nclass Solution {\npublic:\n    bool digitCount(string num) {\n        unordered_map<int,int> m;\n        for(auto x : num){\n            m[x-\'0\']++;\n        }\n\n        for(int i = 0 ; i < num.length();i++){\n            int val = num[i] - \'0\';\n            if(m[i] != val){\n                return false;\n            }\n        }\n\n        return true;\n\n    }\n};\n```
['C++']