Given a list of 24-hour clock times in "HH:MM" format, return the minimum difference in minutes between any two of them. The clock wraps around midnight, so 23:59 and 00:00 are 1 minute apart.
Given a list of 24-hour clock times in "HH:MM" format, return the minimum difference in minutes between any two of them. The clock wraps around midnight, so 23:59 and 00:00 are 1 minute apart.
Example 1:
Input: {"timePoints":["23:59","00:00"]}
Output: 1
Constraints:
2≤timePoints.length≤2×104
timePoints[i] is in the format "HH:MM".
Test Cases
Input (Stdin)
Expected Output (Stdout)
Execution Result
Run code to see results.
Input
arr ={"timePoints":["23:59","00:00"]}
2 time points on a 24-hour clock. The answer is the smallest gap between neighbours on the dial, including the gap across midnight.