Medium

Quiz

#539 Minimum Time Difference

APPROACH

You are given a list of times in "HH:MM" 24-hour format. Return the smallest difference in minutes between any two times in the list, treating the clock as circular (e.g., the gap between "23:59" and "00:00" is 1 minute).

Example 1:

Input: timePoints = ["23:59","00:00"]
Output: 1

Example 2:

Input: timePoints = ["00:00","23:59","00:00"]
Output: 0
1 of 4
1:00

What is the optimal approach for this problem?