✅[C++] || ✅Map solution || ✅O(N) || Easy and clean code
\nclass Solution {\npublic:\n    bool digitCount(string num) {\n        unordered_map<char, int> mpp;\n        \n        for(int i=0; i<num.size(); i++)\n      
```\nclass Solution {\npublic:\n    bool digitCount(string num) {\n        unordered_map<char, int> mpp;\n        \n        for(int i=0; i<num.size(); i++)\n            mpp[num[i]]++;\n        \n\n        for(int i=0; i<num.size(); i++){\n            char c =\'0\' + i;\n            // cout<<c<<endl;\n            if(num[i] != \'0\' + mpp[c]){\n                // cout<<num[i]<<" "<<mpp[c]<<endl;\n                return false;\n            }\n                \n        }\n        \n        return true;\n    }\n};\n```\n\n**Check out my youtube channel for related content\nhttps://www.youtube.com/@ignition548/featured**
['C']