Last active
August 22, 2020 19:20
-
-
Save meekg33k/69cda2970fd17eb883037ad032c5b6f3 to your computer and use it in GitHub Desktop.
Function to find minimum time difference between any two time points in a list
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const findMinTimeDiff = (listOfTimes) => { | |
/** Returns the minimum time difference in minutes between any two points **/ | |
} | |
findMinTimeDiff(['00:00', '00:01']); //should return 1 minute | |
findMinTimeDiff(['00:03', '03:12', '00:00', '03:14']); //should return 2 minutes | |
findMinTimeDiff(['13:20', '00:01', '14:00', '18:05', '13:28']); //should return 8 minutes | |
findMinTimeDiff(['00:00', '00:02', '23:59', '00:05']); //should return 1 minute |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment