Skip to content

Instantly share code, notes, and snippets.

@hackaugusto
Last active January 29, 2020 13:53
Show Gist options
  • Save hackaugusto/42837d20db696e53dd2797404473ab70 to your computer and use it in GitHub Desktop.
Save hackaugusto/42837d20db696e53dd2797404473ab70 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import sys
import datetime
first = None
largest_gap = datetime.timedelta(0)
start = None
end = None
for l in sys.stdin:
second = datetime.datetime.fromisoformat(l.strip())
if first:
gap = second - first
if gap > largest_gap:
start = first
end = second
largest_gap = gap
first = second
print(f"{start} | {end} | {largest_gap}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment