human
Maximize the missing values in given time in HH : MM format | Function to find the maximum time by replacing ' ? ' by any digits.
If the 0 th index is '?.
If the 1 st index is '?.
If the 3 rd index is '?.
If the 4 th index is '?.
Return new string.
Driver Code"
Solution in Python:
assistant
#Here is code to maximize the missing values in given time in HH : MM format and the other steps required.
 def maxTime ( s ) :
'
	s = list ( s )
	if ( s [ 0 ] == ' ? ' ) :
		if ( s [ 1 ] <= '3' or s [ 1 ] == ' ? ' ) :
			s [ 0 ] = '2'
		else :
			s [ 0 ] = '1'
'
	if ( s [ 1 ] == ' ? ' ) :
		if ( s [ 0 ] != '2' ) :
			s [ 1 ] = 9
		else :
			s [ 1 ] = 3
'
	if ( s [ 3 ] == ' ? ' ) :
		s [ 3 ] = '5'
'
	if ( s [ 4 ] == ' ? ' ) :
		s [ 4 ] = '9'
	print ( " " . join ( s ) )
S = " ? 4:5 ? "
maxTime ( S )