package leetcode;

/**
 * https://leetcode.com/problems/widest-vertical-area-between-two-points-containing-no-points/
 */
public class Problem1637 {
    public int maxWidthOfVerticalArea(int[][] points) {
        // TODO
        return 0;
    }

    public static void main(String[] args) {
        Problem1637 prob = new Problem1637();
        System.out.println(prob.maxWidthOfVerticalArea(new int[][]{
            {8,7},{9,9},{7,4},{9,7}
        })); // 1
        System.out.println(prob.maxWidthOfVerticalArea(new int[][]{
            {9,9},{7,4},{9,7}
        })); // 2
        System.out.println(prob.maxWidthOfVerticalArea(new int[][]{
            {3,1},{9,0},{1,0},{1,4},{5,3},{8,8}
        })); // 3
    }
}

@@ -12,16 +12,42 @@
 tcode;%0A%0A
+import java.util.Arrays;%0A%0A
 /**%0A * h
@@ -236,503 +236,320 @@
     
-// TODO%0A        return 0;%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        Problem1637 prob = new Problem1637();%0A        System.out.println(prob.maxWidthOfVerticalArea(new int%5B%5D%5B%5D%7B%0A            %7B8,7%7D,%7B9,9%7D,%7B7,4%7D,%7B9,7%7D%0A        %7D)); // 1%0A        System.out.println(prob.maxWidthOfVerticalArea(new int%5B%5D%5B%5D%7B%0A            %7B9,9%7D,%7B7,4%7D,%7B9,7%7D%0A        %7D)); // 2%0A        System.out.println(prob.maxWidthOfVerticalArea(new int%5B%5D%5B%5D%7B%0A            %7B3,1%7D,%7B9,0%7D,%7B1,0%7D,%7B1,4%7D,%7B5,3%7D,%7B8,8%7D%0A        %7D)); // 3
+int%5B%5D x = new int%5Bpoints.length%5D;%0A        for (int i = 0; i %3C points.length; i++) %7B%0A            x%5Bi%5D = points%5Bi%5D%5B0%5D;%0A        %7D%0A        Arrays.sort(x);%0A        int answer = 0;%0A        for (int i = 0; i %3C x.length - 1; i++) %7B%0A            answer = Math.max(answer, x%5Bi + 1%5D - x%5Bi%5D);%0A        %7D%0A        return answer;
 %0A   

Solve problem 1637