[Java/Python 3] Simple code.
java\n    public boolean digitCount(String num) {\n        int[] cnt = new int[11];\n        char[] charArr = num.toCharArray();\n        for (char d : charArr)
```java\n    public boolean digitCount(String num) {\n        int[] cnt = new int[11];\n        char[] charArr = num.toCharArray();\n        for (char d : charArr) {\n            ++cnt[d - \'0\'];\n        }\n        for (int i = 0; i < charArr.length; ++i) {\n            if (cnt[i] != charArr[i] - \'0\') {\n                return false;\n            }\n        }\n        return true;\n    }\n```\n```python\n    def digitCount(self, num: str) -> bool:\n        c = Counter(map(int, num))\n        return all(c[i] == int(d) for i, d in enumerate(num))\n```
[]