C++ || Easy-to-understand
\nclass Solution {\npublic:\n    bool digitCount(string num) {\n        int n=num.length();\n        map<int,int> mp;\n        for(int i=0;i<n;i++){\n          
```\nclass Solution {\npublic:\n    bool digitCount(string num) {\n        int n=num.length();\n        map<int,int> mp;\n        for(int i=0;i<n;i++){\n            mp[num[i]-\'0\']++;\n        }\n        for(int i=0;i<n;i++){\n            if(mp[i]!=num[i]-\'0\'){\n                return false;\n            }\n        }\n        return true;\n    }\n};\n```
[]