Elegant C++ O(1)
Complexity\n- Time complexity:\nO(1)\n\n- Space complexity:\nO(1)\n\n# Code\ncpp []\nint countTime(string time) {\n    return\n        ( time[0] == \'?\'\n     
# Complexity\n- Time complexity:\n$$O(1)$$\n\n- Space complexity:\n$$O(1)$$\n\n# Code\n```cpp []\nint countTime(string time) {\n    return\n        ( time[0] == \'?\'\n        ? time[1] != \'?\' ? (time[1] < \'4\' ? 03 : 02) : 24\n        : time[1] == \'?\' ? (time[0] < \'2\' ? 10 : 04) : 01 )\n        *\n        ( time[3] == \'?\'\n        ? time[4] == \'?\' ? 60 : 06\n        : time[4] == \'?\' ? 10 : 01 );\n}\n```
['C++']