3114. Latest Time You Can Obtain After Replacing Characters
You are given a string
srepresenting a 12-hour format time where some of the digits (possibly none) are replaced with a"?".12-hour times are formatted as
"HH:MM", whereHHis between00and11, andMMis between00and59. The earliest 12-hour time is00:00, and the latest is11:59.You have to replace all the
"?"characters inswith digits such that the time we obtain by the resulting string is a valid 12-hour format time and is the latest possible.Return the resulting string.
1 |
|