Skip to content

Instantly share code, notes, and snippets.

defmodule SmallestTimeInterval do
@moduledoc """
Given a list of times in a 24-hour period, return the smallest interval between two times in the list. Hint: you can
do this in O(n) time! Assume the list is unsorted.
Example:
$ smallestTimeInterval(['01:00', '08:15', '11:30', '13:45', '14:10', '20:05'])
$ '25 minutes'