Code RoomWard rota ordering
EasyPrep Room Coding #4847

Ward rota ordering

CodingAlgorithms & data structuresEntry–Mid~14 min

A hospital ward posts the next day's rota from two parallel lists. staff holds the name working each shift and starts holds that shift's start time as HH:MM on a 24 hour clock, always two digits for the hour and two for the minutes. The rota day does not begin at midnight. It begins at day_start, written the same way, so a shift beginning exactly at day_start is the first of the day and a shift beginning one minute earlier is the very last. Return the names in rota order, reading from day_start forward and wrapping once past midnight. Two shifts beginning in the same minute keep the order the lists give them. The two lists are always the same length, and an empty rota returns an empty list.

Implement
order_shift_roster(staff: list[str], starts: list[str], day_start: str) → list[str]
Examples
in[["Patel","Okafor","Lindqvist"],["22:00","07:00","06:30"],"07:00"]out["Okafor","Patel","Lindqvist"]
in[["Ade","Brun","Cole","Dey"],["07:00","13:15","07:00","23:45"],"07:00"]out["Ade","Cole","Brun","Dey"]
in[["Iqbal","Novak"],["00:10","23:50"],"00:00"]out["Iqbal","Novak"]
What a strong answer looks like

State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.

0:00 of about 14 min
InputExpectedGot
[["Patel","Okafor","Lindqvist"],["22:00","07:00","06:30"],"07:00"]["Okafor","Patel","Lindqvist"]not run yetsample
[["Ade","Brun","Cole","Dey"],["07:00","13:15","07:00","23:45"],"07:00"]["Ade","Cole","Brun","Dey"]not run yetsample
[["Iqbal","Novak"],["00:10","23:50"],"00:00"]["Iqbal","Novak"]not run yetsample