Given a string time representing a time of day in the format "HH:MM", return the next closest valid time that can be formed by reusing the digits present in time. Each digit may be used an unlimited number of times.
If no valid time can be formed that occurs later on the same day, return the earliest valid time formed from the digits, which occurs on the following day.
Constraints:
time.length
time is a valid time in the format "HH:MM".
Given a string time representing a time of day in the format "HH:MM", return the next closest valid time that can be formed by reusing the digits present in time. Each digit may be used an unlimited number of times.
If no valid time can be formed that occurs later on the same day, return the earliest valid time formed from the digits, which occurs on the following day.
Constraints:
time.length
time is a valid time in the format "HH:MM".