Backtracking
Intuition:\nHere we can see that there is way other than putting characters from 0 to 9 at every ? and counting the total valid ways.\n> This gives us intuition
# Intuition:\nHere we can see that there is way other than putting characters from `0` to `9` at every `?` and counting the total valid ways.\n> This gives us intuition of using `Recursion` which we will use for finding different ways and for backtracking when all ways are explored for current state.\n\n# For every index in string we have two choices :\n1. If character at i\'th index is `\'?\'`, then find all count of ways by replacing from 0 to 9 on it & Backtrack.\n2. If character at i\'th index is not \'?\', simple move ahead get count of next index.    \n# C++\t\n\tint countTime(string time){\n        return solve(time, 0);\n    }\n\n    int convert(string &s, int i){\n        return (s[i] - \'0\') *10 + (s[i + 1] - \'0\');\n    }\n\n    int solve(string &t, int i){\n\n        // Base Case for return 1, if the string is of valid format, else return 0\n        if (i == 5){\n            int a = convert(t, 0) , b = convert(t, 3);\n            return a >= 0 and a <= 23 and b >= 0 and b <= 59;\n        }\n\n        if (t[i] == \'?\'){\n            int ways = 0;\n                    \n            for (char ch = \'0\'; ch <= \'9\'; ch++){\n                t[i] = ch;\n                ways += solve(t, i + 1);\n            }\n                    \n            //Backtrack\n            t[i] = \'?\';\n            return ways;\n        }\n        \n        return solve(t, i + 1);\n    }
['C']