package leetcode;

/**
 * https://leetcode.com/problems/find-right-interval/
 */
public class Problem436 {
    public static class Interval {
        int start;
        int end;

        Interval() {
            start = 0;
            end = 0;
        }

        Interval(int s, int e) {
            start = s;
            end = e;
        }
    }

    public int[] findRightInterval(Interval[] intervals) {
        // TODO
        return new int[0];
    }

    public static void main(String[] args) {
        Problem436 prob = new Problem436();
        System.out.println(prob.findRightInterval(new Interval[]{new Interval(1, 2)}));
        System.out.println(prob.findRightInterval(new Interval[]{
            new Interval(3, 4),
            new Interval(2, 3),
            new Interval(1, 2)
        }));
        System.out.println(prob.findRightInterval(new Interval[]{
            new Interval(1, 4),
            new Interval(2, 3),
            new Interval(3, 4)
        }));
    }
}

@@ -623,25 +623,33 @@
 al(1, 2)%7D));
+ // %5B-1%5D
 %0A
-
         Syst
@@ -805,24 +805,38 @@
         %7D));
+ // %5B-1, 0, 1%5D
 %0A        Sys
@@ -985,16 +985,16 @@
 l(3, 4)%0A
-
         
@@ -997,16 +997,219 @@
     %7D));
+ // %5B-1, 2, -1%5D%0A        System.out.println(prob.findRightInterval(new Interval%5B%5D%7B%0A            new Interval(4, 8),%0A            new Interval(3, 4),%0A            new Interval(1, 4)%0A        %7D)); // %5B-1, 0, 0%5D
 %0A    %7D%0A%7D

Update problem 436