simple java solution
\nclass Solution {\n    public boolean digitCount(String num) {\n        \n        int[] result = new int[10];\n        for(int i=0;i<num.length();i++)\n       
```\nclass Solution {\n    public boolean digitCount(String num) {\n        \n        int[] result = new int[10];\n        for(int i=0;i<num.length();i++)\n        {\n            result[num.charAt(i)-\'0\']++;\n        }\n      \n       for(int i=0;i<num.length();i++)\n       {\n           if(num.charAt(i)-\'0\'!=result[i])\n              return false;\n       }\n        return true;\n    }\n}\n```
['String', 'Java']