Valid Boomerang Lab
In this lab, you will implement a function to determine if a set of points in the X-Y plane represents a valid boomerang. A valid boomerang is a set of three points that are all distinct and not in a straight line.
You will be provided with an array
points[i] = [xi, yi] representing a point on the X-Y plane. Your task is to return
true if these points are a valid boomerang, and
false if they are not.
Here are some examples to help you understand the problem better:
Input: points = [[1,1],[2,3],[3,2]] Output: true
Input: points = [[1,1],[2,2],[3,3]] Output: false
points.length == 3
points[i].length == 2
0 <= xi, yi <= 100
To complete this lab, you have to:
- Implement the
- Export the
isBoomerangfunction as the default export of
- Make sure the function passes all the challenges below.
isBoomerangas the default export of
- Determine if the given set of points represents a valid boomerang.