We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7b655a2 commit be35db0Copy full SHA for be35db0
solutions/1037-valid-boomerang.js
@@ -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