package leetcode;

import java.util.Arrays;
import java.util.List;

/**
 * https://leetcode.com/problems/minimum-time-difference/
 */
public class Problem539 {
    public int findMinDifference(List<String> timePoints) {
        // TODO:
        return 0;
    }

    public static void main(String[] args) {
        Problem539 prob = new Problem539();
        System.out.println(prob.findMinDifference(Arrays.asList("23:59", "00:00"))); // 1
    }
}

@@ -29,21 +29,26 @@
 va.util.
-Array
+Collection
 s;%0Aimpor
@@ -233,217 +233,1193 @@
  // 
-TODO:%0A        return 0;
+I can use some Java time library, but that feels cheating.%0A        Collections.sort(timePoints, (a, b) -%3E %7B
 %0A    
-%7D%0A%0A
     
-public static void main(String%5B%5D args) %7B%0A        Problem539 prob = new Problem539();%0A        System.out.println(prob.findMinDifference(Arrays.asList(%2223:59%22, %2200:00%22))); // 1
+    String%5B%5D aSplit = a.split(%22:%22);%0A            int aHour = Integer.parseInt(aSplit%5B0%5D);%0A            int aMinute = Integer.parseInt(aSplit%5B1%5D);%0A%0A            String%5B%5D bSplit = b.split(%22:%22);%0A            int bHour = Integer.parseInt(bSplit%5B0%5D);%0A            int bMinute = Integer.parseInt(bSplit%5B1%5D);%0A%0A            int cmp = Integer.compare(aHour, bHour);%0A            if (cmp == 0) %7B%0A                return Integer.compare(aMinute, bMinute);%0A            %7D%0A            return cmp;%0A        %7D);%0A        int min = Integer.MAX_VALUE;%0A        for (int i = 1; i %3C timePoints.size(); i++) %7B%0A            int diff = toMinutes(timePoints.get(i)) - toMinutes(timePoints.get(i - 1));%0A            min = Math.min(min, diff);%0A        %7D%0A        int diff = toMinutes(timePoints.get(0)) + (60 * 24) - toMinutes(timePoints.get(timePoints.size() - 1));%0A        min = Math.min(min, diff);%0A        return min;%0A    %7D%0A%0A    private static int toMinutes(String time) %7B%0A        String%5B%5D timeSplit = time.split(%22:%22);%0A        return (Integer.parseInt(timeSplit%5B0%5D) * 60) + Integer.parseInt(timeSplit%5B1%5D);
 %0A   

Solve problem 539