#1037
Valid Boomerang
pupil · 550 · lc easy +28 · verified · 39.2% accepted · 463 likes · top 18%
Description
Given an array points of three 2D points points[i] = [xi, yi], return true if the three points form a boomerang.
A boomerang is a set of three distinct points that do not all lie on the same straight line.
Example 1:
Input: points = [[1,1],[2,3],[3,2]]
Output: true
Example 2:
Input: points = [[1,1],[2,2],[3,3]]
Output: false
Code
1
2
3