Minimum Time Difference

Given a list of 24-hour clock time points in "HH:MM" format, return the minimum minutes difference between any two time-points in the list.

Example 1
InputtimePoints = ["23:59","00:00"]
Output1
The time difference between 23:59 and 00:00 is 1 minute across midnight.
Example 2
InputtimePoints = ["00:00","23:59","00:00"]
Output0
There are two identical time points, so the minimum difference is 0 minutes.

Constraints

  • 2 <= timePoints.length <= 2 * 10^4
  • timePoints[i] is in the format "HH:MM".

Asked at 8 companies

</>

Your Solution

(Ctrl/Cmd + Enter)

Switching Language

Loading template...

Loading...

Sign in to save your progress

AI code evaluation

Get a correctness verdict, missed edge cases, and complexity analysis of your solution.

Sign in to evaluate