java solution
Time : h1h2:m1m2\ne.g. 03:54 means h1 =0 , h2 = 3, m1 = 5, and m2 =4\n\nclass Solution {\n    public int countTime(String time) {\n        int ans = 1;\n       
Time : h1h2:m1m2\ne.g. 03:54 means h1 =0 , h2 = 3, m1 = 5, and m2 =4\n```\nclass Solution {\n    public int countTime(String time) {\n        int ans = 1;\n       \n        int h1 = time.charAt(0) - \'0\';\n        int h2 = time.charAt(1) - \'0\';\n        int m1 = time.charAt(3) - \'0\';\n        int m2 = time.charAt(4) - \'0\';\n        \n        //h1\n        if(isQuestionMark(h1)) {\n            if(isQuestionMark(h2)) {\n                ans = 24;\n            } else if(h2 >= 4) {\n                ans = 2;\n            } else {\n                ans = 3;\n            }\n        }   \n        //h2 \n        if(isQuestionMark(h2) && !isQuestionMark(h1)) {\n            if(h1 == 2){\n                ans *= 4;\n            } else {\n                ans *= 10;\n            }\n        }\n        \n        //m1\n        if(isQuestionMark(m1))\n            ans *= 6;\n\t\t//m2\n        if(isQuestionMark(m2))\n            ans *= 10;\n        \n        return ans;\n    }\n\n    public boolean isQuestionMark (int h1) {\n        if(h1 > 9  || h1 < 0) {\n            return true;\n        } \n        return false;\n    }\n}\n```
['String', 'Java']