package leetcode;

/**
 * https://leetcode.com/problems/valid-boomerang/
 */
public class Problem1037 {
    public boolean isBoomerang(int[][] points) {
        // TODO
        return false;
    }

    public static void main(String[] args) {
        Problem1037 prob = new Problem1037();
        System.out.println(prob.isBoomerang(new int[][]{
            {1, 1}, {2, 3}, {3, 2}
        })); // true
        System.out.println(prob.isBoomerang(new int[][]{
            {1, 1}, {2, 2}, {3, 3}
        })); // false
        System.out.println(prob.isBoomerang(new int[][]{
            {0, 1}, {0, 2}, {0, 3}
        })); // false
        System.out.println(prob.isBoomerang(new int[][]{
            {0, 1}, {0, 2}, {2, 3}
        })); // true
        System.out.println(prob.isBoomerang(new int[][]{
            {0, 1}, {0, 1}, {0, 1}
        })); // false
        System.out.println(prob.isBoomerang(new int[][]{
            {0, 1}, {0, 1}, {0, 1}
        })); // false
        System.out.println(prob.isBoomerang(new int[][]{
            {1, 1}, {2, 3}, {3, 5}
        })); // false
        System.out.println(prob.isBoomerang(new int[][]{
            {1, 1}, {2, 3}, {3, 6}
        })); // true
    }
}

@@ -161,1041 +161,406 @@
  // 
-TODO%0A        return false;%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        Problem1037 prob = new Problem1037();%0A        System.out.println(prob.isBoomerang(new int%5B%5D%5B%5D%7B%0A            %7B1, 1%7D, %7B2, 3%7D, %7B3, 2%7D%0A        %7D)); // true%0A        System.out.println(prob.isBoomerang(new int%5B%5D%5B%5D%7B%0A            %7B1, 1%7D, %7B2, 2%7D, %7B3, 3%7D%0A        %7D)); // false%0A        System.out.println(prob.isBoomerang(new int%5B%5D%5B%5D%7B%0A            %7B0, 1%7D, %7B0, 2%7D, %7B0, 3%7D%0A        %7D)); // false%0A        System.out.println(prob.isBoomerang(new int%5B%5D%5B%5D%7B%0A            %7B0, 1%7D, %7B0, 2%7D, %7B2, 3%7D%0A        %7D)); // true%0A        System.out.println(prob.isBoomerang(new int%5B%5D%5B%5D%7B%0A            %7B0, 1%7D, %7B0, 1%7D, %7B0, 1%7D%0A        %7D)); // false%0A        System.out.println(prob.isBoomerang(new int%5B%5D%5B%5D%7B%0A            %7B0, 1%7D, %7B0, 1%7D, %7B0, 1%7D%0A        %7D)); // false%0A        System.out.println(prob.isBoomerang(new int%5B%5D%5B%5D%7B%0A            %7B1, 1%7D, %7B2, 3%7D, %7B3, 5%7D%0A        %7D)); // false%0A        System.out.println(prob.isBoomerang(new int%5B%5D%5B%5D%7B%0A            %7B1, 1%7D, %7B2, 3%7D, %7B3, 6%7D%0A        %7D)); // true
+Note: slope of 2 points (x1, y1), (x2, y2)%0A        // (y2 - y2) / (x2 - x1)%0A        int%5B%5D a = points%5B0%5D; // (x1, y1)%0A        int%5B%5D b = points%5B1%5D; // (x2, y2)%0A        int%5B%5D c = points%5B2%5D; // (x3, y3)%0A        // (y2 %E2%88%92 y1) / (x2 %E2%88%92 x1) == (y3 %E2%88%92 y1) / (x3 %E2%88%92 x1)%0A        // (y2 %E2%88%92 y1) * (x3 %E2%88%92 x1) == (y3 %E2%88%92 y1) * (x2 %E2%88%92 x1)%0A        return !((b%5B1%5D - a%5B1%5D) * (c%5B0%5D - a%5B0%5D) == ((c%5B1%5D - a%5B1%5D) * (b%5B0%5D - a%5B0%5D)));
 %0A   

Solve problem 1037