C++ || O(1)
\nclass Solution {\npublic:\n    int countTime(string time) {\n        int a = 1, b = 1, c = 1, d = 1;\n        if(time[0] == \'?\')\n        {\n            if(
```\nclass Solution {\npublic:\n    int countTime(string time) {\n        int a = 1, b = 1, c = 1, d = 1;\n        if(time[0] == \'?\')\n        {\n            if(time[1] - \'0\' <= 3 || time[1] == \'?\')\n              a = 3;\n            else a = 2;\n        }\n        if(time[1] == \'?\')\n        {\n            if(time[0] - \'0\' == 2)\n                b = 4;\n            else if(time[0] == \'?\')\n                b = 8; // for ?? : mm we can have 24 options, so in the end we will multiply a*b (ie, 3*8) to get 24 choices\n            else b = 10;\n        }\n        if(time[3] == \'?\')\n        {\n            c = 6;\n        }\n        if(time[4] == \'?\')\n        {\n            d = 10;\n        }\n        return a*b*c*d;\n    }\n};\n```
[]