#3114

Latest Time You Can Obtain After Replacing Characters

pupil · 525 · lc easy +28 · 35.1% accepted · 118 likes · top 13%

Description

Given a 12-hour time string s in "HH:MM" format where some digits are replaced by '?', fill in every '?' with a digit to produce the latest valid 12-hour time (hours 0011, minutes 0059). Return the completed string.

Code

1
2
3