LeetCode 1037. Valid Boomerang
2023-04-01 11:53 作者:您是打尖兒還是住店呢 | 我要投稿
Given an array?points
?where?points[i] = [xi, yi]
?represents a point on the?X-Y?plane, return?true
?if these points are a?boomerang.
A?boomerang?is a set of three points that are?all distinct?and?not in a 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
?
Constraints:
points.length == 3
points[i].length == 2
0 <= xi, yi?<= 100
就是判斷斜率是否相等,相等了,那么就不能組成三角形了,easy題目;
Runtime:?0 ms, faster than?100.00%?of?Java?online submissions for?Valid Boomerang.
Memory Usage:?39.9 MB, less than?68.82%?of?Java?online submissions for?Valid Boomerang.
標(biāo)簽:Leetcode