Easy solution | Unordered map
\n# Code\n\nclass Solution {\npublic:\n    bool digitCount(string num) {\n        unordered_map<int,int> mpp;\n        for(auto i:num){\n            mpp[i-\'0\'
\n# Code\n```\nclass Solution {\npublic:\n    bool digitCount(string num) {\n        unordered_map<int,int> mpp;\n        for(auto i:num){\n            mpp[i-\'0\']++;\n        }\n        for(int i=0;i<num.size();i++){\n            if(num[i]-\'0\' != mpp[i]){\n                return false;\n            }\n        }\n        return true;\n    }\n};\n```
['String', 'Ordered Map', 'C++']