Number of Valid Clock Times
You are given a string of length 5 called time, representing the current time on a digital clock in the format "hh:mm". The earliest possible time is "00:00" and the latest possible time is "23:59".
In the string time, the digits represented by the ? symbol are unknown, and must be replaced with a digit from 0 to 9.
Return an integer answer, the number of valid clock times that can be created by replacing every ? with a digit from 0 to 9.
Example 1
Input
time = "?5:00"Output
2We can replace the ? with either a 0 or 1, producing "05:00" or "15:00", but not 2 because "25:00" is invalid.
Example 2
Input
time = "0?:0?"Output
100Each ? can be replaced by any digit from 0 to 9, so we have 100 total choices.
Constraints
timeis a valid string of length5in the format"hh:mm"."00" <= hh <= "23""00" <= mm <= "59"- Some of the digits might be replaced with
'?'and need to be replaced with digits from0to9.