Easiest solution in C++ with If-else||100%||O(1)
\n# Code\n\nclass Solution {\npublic:\nint countTime(string s) {\n    int ans1=1;\n    int ans2=1;\n    if(s[0]==\'?\' and s[1]==\'?\'){\n        ans1*=24;\n   
\n# Code\n```\nclass Solution {\npublic:\nint countTime(string s) {\n    int ans1=1;\n    int ans2=1;\n    if(s[0]==\'?\' and s[1]==\'?\'){\n        ans1*=24;\n    }\n    else if(s[0]==\'?\' and s[1]!=\'?\'){\n        if(s[1]<=\'3\') \n            ans1*=3;\n        if(s[1]>\'3\') \n        ans1*=2;\n    }   \n    if(s[0]!=\'?\' and s[1]==\'?\'){\n        if(s[0]==\'2\')\n            ans1*=4;\n        else\n            ans1*=10;\n    }\n    if(s[3]==\'?\' and s[4]==\'?\'){\n        ans2*=60;\n    }\n    else if(s[3]==\'?\' and s[4]!=\'?\')\n        ans2*=6;\n    if(s[3]!=\'?\' and s[4]==\'?\'){\n        ans2*=10;\n    }\n    return ans1*ans2;\n}\n};\n```
['C++']