C++ clean solution
\nclass Solution {\npublic:\n    int countTime(string time) {\n        string hr = time.substr(0,2),mn = time.substr(3);\n        int res = 1;\n        if(hr[0]
```\nclass Solution {\npublic:\n    int countTime(string time) {\n        string hr = time.substr(0,2),mn = time.substr(3);\n        int res = 1;\n        if(hr[0] == \'?\' and hr[1]==\'?\'){\n            res = 24;\n        }else if(hr[0] == \'?\'){\n            res = hr[1] <=\'3\'?3:2;\n        }else if(hr[1] == \'?\'){\n            res = hr[0] < \'2\'?10:4;\n        }\n        \n        if(mn[0] == \'?\' and mn[1] == \'?\'){\n            res*=60;\n        }else if(mn[0] ==\'?\'){\n            res*=6;\n        }else if(mn[1] == \'?\'){\n            res*=10;\n        }\n        return res;\n    }\n};\n```
[]