LearnPy Hub
← Arena
IntermediateRating 1300

Closest Two Times

Times are given as HH:MM on a 24-hour clock. Print the smallest difference in minutes between any two of them (the clock wraps around midnight).

Input

n, then n times separated by spaces.

Output

One integer.

Sample 1

Input
2
23:59 00:00
Output
1

Sample 2

Input
3
00:00 23:59 00:00
Output
0
solution.py
Output appears here
Closest Two Times · Python Arena problem · LearnPy Hub