Simple Java Function Solution 2ms and 70.82% faster.
\nclass Solution {\n    public boolean digitCount(String nums) {\n        int arr[] =new int[nums.length()];\n        \n        for(int i=0;i<nums.length();i++)
```\nclass Solution {\n    public boolean digitCount(String nums) {\n        int arr[] =new int[nums.length()];\n        \n        for(int i=0;i<nums.length();i++){\n        int a =nums.charAt(i)-48; //ascii value 0\n\t\t//or you can use to convert every value by\n\t\t// int a = Character.getNumericValue(i);\n\t\t// int a = nums.charAt(i)-\'0\';\n\t\t// int a = Integer.parseInt(String.valueOf(i));\n        arr[i]=a;\n        }\n        for(int i=0;i<arr.length;i++){\n            \n            boolean a =tf(arr,arr[i],i);\n            if(!a){\n                return false;\n            }\n        }\n        \n        return true;\n    }\n    public boolean tf(int arr[],int fn,int sn){\n        \n        int count =0;\n        for(int i=0;i<arr.length;i++){\n        if(sn==arr[i]){\n            count++;\n        }\n        }\n        if(count==fn){\n            return true;\n        }\n        return false;\n        \n    }\n}\n\n\n\n\n\n\n\n\n\n\n\n```
['Java']