package leetcode;

/**
 * https://leetcode.com/problems/minimum-number-of-arrows-to-burst-balloons/
 */
public class Problem452 {
    public int findMinArrowShots(int[][] points) {
        // TODO
        return 0;
    }

    public static void main(String[] args) {
        Problem452 prob = new Problem452();
        System.out.println(prob.findMinArrowShots(new int[][]{{10, 16}, {2, 8}, {1, 6}, {7, 12}})); // 2
    }
}

@@ -12,16 +12,42 @@
 tcode;%0A%0A
+import java.util.Arrays;%0A%0A
 /**%0A * h
@@ -212,32 +212,733 @@
     
-// TODO%0A        return 0
+if (points.length == 0) %7B%0A            return 0;%0A        %7D%0A        Arrays.sort(points, (a, b) -%3E %7B%0A            int comp = Integer.compare(a%5B0%5D, b%5B0%5D);%0A            if (comp == 0) %7B%0A                return Integer.compare(a%5B1%5D, b%5B1%5D);%0A            %7D%0A            return comp;%0A        %7D);%0A        for (int i = 0; i %3C points.length; i++) %7B%0A            System.out.println(points%5Bi%5D%5B0%5D + %22:%22 + points%5Bi%5D%5B1%5D);%0A        %7D%0A        int end1 = points%5B0%5D%5B1%5D;%0A        int result = 1;%0A        for (int i = 1; i %3C points.length; i++) %7B%0A            int start2 = points%5Bi%5D%5B0%5D;%0A            int end2 = points%5Bi%5D%5B1%5D;%0A            if (start2 %3E end1) %7B%0A                result++;%0A                end1 = end2;%0A            %7D%0A        %7D%0A        return result
 ;%0A  
@@ -1031,16 +1031,18 @@
 m452();%0A
+//
         
@@ -1138,16 +1138,754 @@
 ); // 2%0A
+//        System.out.println(prob.findMinArrowShots(new int%5B%5D%5B%5D%7B%7B10, 16%7D, %7B2, 8%7D, %7B1, 6%7D, %7B7, 9%7D%7D)); // 3%0A//        System.out.println(prob.findMinArrowShots(new int%5B%5D%5B%5D%7B%7B1, 6%7D, %7B7, 8%7D, %7B9, 10%7D%7D)); // 3%0A//        System.out.println(prob.findMinArrowShots(new int%5B%5D%5B%5D%7B%7B1, 6%7D, %7B7, 8%7D, %7B8, 10%7D%7D)); // 2%0A//        System.out.println(prob.findMinArrowShots(new int%5B%5D%5B%5D%7B%7B1, 6%7D%7D)); // 1%0A//        System.out.println(prob.findMinArrowShots(new int%5B%5D%5B%5D%7B%7D)); // 0%0A//        System.out.println(prob.findMinArrowShots(new int%5B%5D%5B%5D%7B%7B3, 9%7D, %7B7, 12%7D, %7B3, 8%7D, %7B6, 8%7D, %7B9, 10%7D, %7B2, 9%7D, %7B0, 9%7D, %7B3, 9%7D, %7B0, 6%7D, %7B2, 8%7D%7D)); // 2%0A        System.out.println(prob.findMinArrowShots(new int%5B%5D%5B%5D%7B%7B9, 12%7D, %7B1, 10%7D, %7B4, 11%7D, %7B8, 12%7D, %7B3, 9%7D, %7B6, 9%7D, %7B6, 7%7D%7D)); // 2%0A
     %7D%0A%7D%0A

Update problem 452