Atrium Roster Sorted Signal
Every afternoon the atrium stage manager records rehearsal slots as minute timestamps in HH:MM format, capturing the exact moment each ensemble expects to plug in. The board fills quickly as dozens of acts glide through, and before the sound engineer locks the final mix they want to know whether the roster already moves from the earliest call time to the latest. Your routine reviews the recorded strings and returns a simple verdict—true when the list never steps backward in time, false otherwise—so the team can share a confident yes-or-no update over the comms without touching the original schedule.
Some entries repeat because an act needs adjacent slots for costume swaps, and the board can also be empty when the day is still quiet. Leading zeros always appear on the clock, and every string uses a 24-hour range from 00:00 to 23:59, so the routine only needs to compare the timestamps lexically after parsing the hours and minutes. If a call time arrives earlier than the one before it, the answer flips to false, signalling that a quick re-sequencing is required. Otherwise return true, keeping rehearsal prep calm and predictable.
Example 1:
Input: times = ["14:10","14:45","15:00","15:00"]
Output: true
Explanation: Each call is later than or equal to the previous, so the roster is in order.
Example 2:
Input: times = ["09:30","09:15","09:45"]
Output: false
Explanation: The second slot jumps backward, signalling the board needs adjustment.
Example 3:
Input: times = []
Output: true
Explanation: No scheduled rehearsals means the list is trivially sorted.
Related Problems
No related problems found
Comments (0)
Join the Discussion
Share your thoughts, ask questions, or help others with this problem.
