Hi! One other question in the same batch is LC1438.
Please check out the second source image below for more details :)
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.
plan = ["12:30","14:00", "19:55"] slot = "14:30" return = 30
- Total Palindrome Substring CostOA · Seen Jun 2026
- Earliest Time All Users Are ConnectedPHONE SCREEN · Seen May 2026
- Tournament Rounds by RankPHONE SCREEN · Seen May 2026
- Farthest Seat AssignmentONSITE INTERVIEW · Seen May 2026
- Convex Function MinimizationPHONE SCREEN · Seen May 2026
- Maximal Square AreaONSITE INTERVIEW · Seen May 2026
- First Unique IP Hitting the ServerPHONE SCREEN · Seen May 2026
- Jump Game with Prime-Step RuleOA · Seen May 2026
public int busTime(String[] plan, String slot) {
// write your code here
}