C++ || Easy || Explained || Map || ✅
create a map to calculate the frequency\n2. iterate the string & check if frequncy is same with index+1 if not matched return false\n3. else return true\n\n\ncl
1. create a map to calculate the frequency\n2. iterate the string & check if frequncy is same with index+1 if not matched return false\n3. else return true\n\n```\nclass Solution {\npublic:\n    bool digitCount(string s) {\n        unordered_map<char, int>mp;\n        for(int i=0;i<s.size();i++)\n            mp[s[i]]++;\n        for(int i=0; i<s.size(); i++)\n        {\n            char c=i+\'0\';\n            if(mp[c]!=s[i]-\'0\')\n                return false;\n        }\n        \n        return true;\n    }\n};\n```
['C']