4 Lines Python Solution

  • 0
    minutes = sorted([60*int(x[0]) + int(x[1]) for x in [y.split(":") for y in timePoints]])
            dis = min(minutes[i+1] - minutes[i] for i in range(len(minutes) - 1))
            dis = min(dis, minutes[0]+24*60 - minutes[-1])
            return dis

Log in to reply

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.