2 liner C++
\nclass Solution {\npublic:\n    bool digitCount(string num) {\n        for(int i=0;i<num.size();i++) if(count(num.begin(),num.end(),(i+\'0\')) != num[i]-\'0\')
```\nclass Solution {\npublic:\n    bool digitCount(string num) {\n        for(int i=0;i<num.size();i++) if(count(num.begin(),num.end(),(i+\'0\')) != num[i]-\'0\') return false;\n        return true;\n    }\n};\n```\n\n\n\n**With Using Extra space :** \n```\nclass Solution {\npublic:\n    bool digitCount(string num) {\n        unordered_map<char,int> mpp;\n        for(auto c : num) mpp[c]++;\n        for(int i=0;i<num.size();i++){\n            char c = (char)i+\'0\';\n            if(num[i]-\'0\' != mpp[c]) return false;\n        }\n         return true;\n     \n    }\n};\n```
['C', 'C++']