Package g1001_1100.s1037_valid_boomerang
Class Solution
java.lang.Object
g1001_1100.s1037_valid_boomerang.Solution
1037 - Valid Boomerang.<p>Easy</p>
<p>Given an array <code>points</code> where <code>points[i] = [x<sub>i</sub>, y<sub>i</sub>]</code> represents a point on the <strong>X-Y</strong> plane, return <code>true</code> <em>if these points are a <strong>boomerang</strong></em>.</p>
<p>A <strong>boomerang</strong> is a set of three points that are <strong>all distinct</strong> and <strong>not in a straight line</strong>.</p>
<p><strong>Example 1:</strong></p>
<p><strong>Input:</strong> points = [[1,1],[2,3],[3,2]]</p>
<p><strong>Output:</strong> true</p>
<p><strong>Example 2:</strong></p>
<p><strong>Input:</strong> points = [[1,1],[2,2],[3,3]]</p>
<p><strong>Output:</strong> false</p>
<p><strong>Constraints:</strong></p>
<ul>
<li><code>points.length == 3</code></li>
<li><code>points[i].length == 2</code></li>
<li><code>0 <= x<sub>i</sub>, y<sub>i</sub> <= 100</code></li>
</ul>
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Solution
public Solution()
-
-
Method Details
-
isBoomerang
public boolean isBoomerang(int[][] points)
-