Java Solution
```java\nclass Solution {\n    public int countTime(String time) {\n        int ans = 1;\n        char[] str = time.toCharArray();\n        int h0 = str[0] - \'
```java\nclass Solution {\n    public int countTime(String time) {\n        int ans = 1;\n        char[] str = time.toCharArray();\n        int h0 = str[0] - \'0\', h1 = str[1] - \'0\';\n        if(str[4] == \'?\') {\n            ans *= 10;\n        }\n        if(str[3] == \'?\') {\n            ans *= 6;\n        }\n        if(str[1] == \'?\') {\n            if(str[0] >= \'0\' && str[0] <= \'1\') {\n                ans *= 10;\n            }\n            else if(str[0] == \'2\') {\n                ans *= 4;\n            }\n            else if(str[0] == \'?\') {\n                ans *= 24;\n            }\n        }\n        if(str[0] == \'?\') {\n            if(str[1] >= \'0\' && str[1] <= \'3\') {\n                ans *= 3;\n            }\n            else if(str[1] >= \'4\' && str[1] <= \'9\') {\n                ans *= 2;\n            }\n        }\n        return ans;\n    }\n}
['String', 'Greedy']