Recursion | C++
\nclass Solution { \n    int ans = 0;\n    void solve(string &s, int ind) {\n        int n = s.size();\n        \n        if (ind == n) {\n            int flag 
```\nclass Solution { \n    int ans = 0;\n    void solve(string &s, int ind) {\n        int n = s.size();\n        \n        if (ind == n) {\n            int flag = 1;\n            for(auto &i: s)  {\n                if (i == \'?\') return;\n            }\n            \n            int tt = stoi(s.substr(0, 2));\n            int mm = stoi(s.substr(3));\n            \n            if (tt > 23 or mm > 59) return;\n            int temp = tt * 60 + mm;\n\n            if (temp < 1440)\n                ans++;\n            \n            return;\n        }\n        \n        if (s[ind] == \'?\') {\n            for (int i = 0; i <= 9; i++) {\n                s[ind] = \'0\' + i;\n                solve(s, ind + 1);\n                s[ind] = \'?\';\n            }\n        }    \n        \n        solve(s, ind + 1);\n    }\npublic:\n    int countTime(string time) {\n        ans = 0;\n        solve(time, 0);\n        return ans;\n    }\n};\n```
['Recursion', 'C']