📌Easy Java☕ solution using hashmap
```\nclass Solution {\n    public boolean digitCount(String num) \n    {\n        HashMap hmap = new HashMap<>();\n        for(char ch:num.toCharArray())\n     
```\nclass Solution {\n    public boolean digitCount(String num) \n    {\n        HashMap<Integer,Integer> hmap = new HashMap<>();\n        for(char ch:num.toCharArray())\n            hmap.put(Character.getNumericValue(ch),hmap.getOrDefault(Character.getNumericValue(ch),0)+1);\n        \n        for(int i=0;i<num.length();i++)\n        {\n            if(hmap.get(i)!=null && hmap.get(i)!=Character.getNumericValue(num.charAt(i)))\n                return false;\n            else if(hmap.get(i)==null && Character.getNumericValue(num.charAt(i))!=0)\n                return false;\n        }\n        return true;\n    }\n}
['Java']