Skip to content

Commit be35db0

Browse files
committed
Add solution #1037
1 parent 7b655a2 commit be35db0

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

solutions/1037-valid-boomerang.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
* 1037. Valid Boomerang
3+
* https://leetcode.com/problems/valid-boomerang/
4+
* Difficulty: Easy
5+
*
6+
* A boomerang is a set of 3 points that are all distinct and not in a straight line.
7+
*
8+
* Given a list of three points in the plane, return whether these points are a boomerang.
9+
*/
10+
11+
/**
12+
* @param {number[][]} points
13+
* @return {boolean}
14+
*/
15+
var isBoomerang = function(points) {
16+
return (points[0][1] - points[1][1]) * (points[1][0] - points[2][0])
17+
!== (points[0][0] - points[1][0]) * (points[1][1] - points[2][1]);
18+
};

0 commit comments

Comments
 (0)