Java | Beginner friendly
\nclass Solution {\n    public int countTime(String time) {\n        \n        char[] s = time.toCharArray();\n        \n        int ans=1;\n\n        if(s[0]==
```\nclass Solution {\n    public int countTime(String time) {\n        \n        char[] s = time.toCharArray();\n        \n        int ans=1;\n\n        if(s[0]==\'?\'){\n\n            if(s[1]==\'?\'){\n\n                ans*=24;\n\n            }else{\n\n                if(s[1]<=\'3\')\n\n                    ans*=3;\n\n                else\n\n                    ans*=2;\n\n            }\n\n        }\n\n        else if(s[1]==\'?\'){\n\n            if(s[0]<\'2\'){\n\n                ans*=10;\n\n            }else{\n\n                ans*=4;\n\n            }\n\n        }\n\n        \n\n        if(s[3]==\'?\'){\n\n            if(s[4]==\'?\'){\n\n                ans*=60;\n\n            }else{\n\n                ans*=6;\n\n            }\n\n        }else if(s[4]==\'?\'){\n\n            ans*=10;\n\n        }\n\n        return ans; \n    }\n}\n```
['Java']