C++ | Implementation | Easy Solution | 100% Fast and Clean Code
\nclass Solution {\npublic:\n    int countTime(string time) \n    {\n        int ans=1;\n\t\t//If first & second position are empty then the time will be in eve
```\nclass Solution {\npublic:\n    int countTime(string time) \n    {\n        int ans=1;\n\t\t//If first & second position are empty then the time will be in every hour that\'s why multiplying by 24\n        if(time[0]==\'?\' && time[1]==\'?\')\n        {\n            ans*=24;            \n        }\n\t\t//If only first position is empty then we check 2nd digit if it is greater than 3 beacuse time will only be upto 23:59\n        else if(time[0]==\'?\')\n        {\n            if(time[1]>\'3\') ans*=2;\n            else ans*=3;\n        }\n\t\t//If second position is empty then we check first position if it is less than 2 \n        else if(time[1]==\'?\') \n        {\n            if(time[0]<\'2\') ans*=10;\n            else ans*=4;\n        }\n\t\t//If fourth position is empty we have 6 values possible 0,1,2,3,4,5 beacuse time in minutes is till 23:59\n        if(time[3]==\'?\') ans*=6;\n\t\t//If last position is empty then we have all 10 values possible\n        if(time[4]==\'?\') ans*=10;\n        return ans;\n    }\n};\n```
['C', 'C++']