Talentd
FleetCode

539. Minimum Time Difference

Medium62.7% acceptance9 companies
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:

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

Example 2:

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

Constraints:

  • 2 <= timePoints.length <= 2 * 104
  • timePoints[i] is in the format "HH:MM".
15:01
Still stuck?Read 3 approaches, or watch a walkthrough.
Open solution
Loading editor…
1class Solution:
2 def findMinDifference(self, timePoints: List[str]) -> int:
3
Starter codePython 3Spaces: 4
Examples
Input
["23:59","00:00"]
Input
["00:00","23:59","00:00"]
Your code is saved on this device.Solution