Your question is Closest Past Departure Time. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Circle's payout scheduler stores same-day departure times as strings in HH:MM format. Given an unsorted list of departure times and the current time, return how many minutes ago the closest departure at or before the current time occurred.
If no departure has occurred yet, return -1. Treat all times as occurring on the same day. Do not wrap around midnight, and do not select a departure after the current time.
Implement find_latest_departure(departures, current_time):
departures is a list of strings, where each string has the format HH:MM.current_time is a string in the same format.current_minutes - departure_minutes, or -1 if no valid departure exists.def find_latest_departure(departures, current_time):