Logo

Bus Time

FULLTIME

Once upon a time in a bustling city, there was a bus stop where buses departed throughout the day. The city's transportation department had a neat little list called the "schedule," which recorded all the bus departure times in the order they were set to leave. Each bus left precisely on time, and the townsfolk could rely on this schedule to plan their travels.

One day, a traveler stood at the bus stop, eager to know when the last bus had departed. The current time was displayed on a big clock at the stop, showing the hour and minute in a 24-hour format. The traveler wanted to find out how many minutes had passed since the last bus had left. However, if the traveler was so early that no bus had left yet, they needed to know this as well.

To solve this mystery, the traveler needed a simple yet effective way to compare the current time with the times listed in the schedule. They knew that if a bus was scheduled to leave at the exact current time, it hadn't left yet, so they didn't count that as "already departed."

And so, with the schedule in hand and the current time on the clock, the traveler set out to discover the number of minutes since the last bus had departed, or to determine if no buses had left yet, returning to their journey either informed or still waiting for the day's first bus.

Example 1 :

Input:
plan = ["12:30","14:00", "19:55"]
slot = "14:30"

Output:
30