Java | Easy to understand | Simple
\nclass Solution {\n    public int countTime(String time) {\n        int h = 1;\n        int m = 1;\n        if (time.charAt(1) == \'?\' && time.charAt(0) == \'
```\nclass Solution {\n    public int countTime(String time) {\n        int h = 1;\n        int m = 1;\n        if (time.charAt(1) == \'?\' && time.charAt(0) == \'?\') {\n            h = 24;\n        } else if (time.charAt(1) == \'?\') {\n            int d = time.charAt(0) - \'0\';\n            h = (d == 2) ? 4 : 10;\n        } else if (time.charAt(0) == \'?\') {\n            int d = time.charAt(1) - \'0\';\n            if (d <= 3) {\n                h = 3;\n            } else {\n                h = 2;\n            }\n        }\n        \n        if (time.charAt(3) == \'?\' && time.charAt(4) == \'?\') {\n            m = 60;\n        } else if (time.charAt(4) == \'?\') {\n            m = 10;\n        } else if (time.charAt(3) == \'?\') {\n            m = 6;\n        }\n        \n        return h * m;\n    }\n}\n```
['Java']