当前位置:网站首页>Force buckle 1037 Effective boomerang
Force buckle 1037 Effective boomerang
2022-07-07 20:06:00 【Tomorrowave】
1037. Effective boomerang
Given an array points , among points[i] = [xi, yi] Express X-Y A point on the plane , If these points form a Boomerang Then return to true .
Boomerang Defined as a set of three points , These points Each are not identical 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
Tips :
points.length == 3
points[i].length == 2
0 <= xi, yi <= 100
Ideas
Mathematical thought of three points collinear
Code section
class Solution:
def isBoomerang(self, points: List[List[int]]) -> bool:
o=points[0]
points[1][0]-=points[0][0]
points[1][1] -= points[0][1]
points[2][0] -= points[0][0]
points[2][1] -= points[0][1]
res=points[1][0]*points[2][1]-points[1][1]*points[2][0]
return res !=0
边栏推荐
- 时间工具类
- 关于自身的一些安排
- 力扣 88.合并两个有序数组
- Chapter 20 using work queue manager (3)
- 841. String hash
- 微信公众号OAuth2.0授权登录并显示用户信息
- 【Auto.js】自动化脚本
- How to cooperate among multiple threads
- mock. JS returns an array from the optional data in the object array
- R language ggplot2 visualization: use the ggdensity function of ggpubr package to visualize the packet density graph, and use stat_ overlay_ normal_ The density function superimposes the positive dist
猜你喜欢

开源OA开发平台:合同管理使用手册

Classification automatique des cellules de modules photovoltaïques par défaut dans les images de lecture électronique - notes de lecture de thèse

8 CAS

数据孤岛是企业数字化转型遇到的第一道险关

Dynamic addition of El upload upload component; El upload dynamically uploads files; El upload distinguishes which component uploads the file.

PMP practice once a day | don't get lost in the exam -7.7

openEuler 资源利用率提升之道 01:概论

mock. JS returns an array from the optional data in the object array

Cloud component development and upgrading
![最多可以参加的会议数目[贪心 + 优先队列]](/img/f3/e8e939e0393efc404cc159d7d33364.png)
最多可以参加的会议数目[贪心 + 优先队列]
随机推荐
【剑指offer】剑指 Offer II 012. 左右两边子数组的和相等
R language dplyr package select function, group_ The by function, filter function and do function obtain the third largest value of a specific numerical data column in a specified level in a specified
BI的边界:BI不适合做什么?主数据、MarTech?该如何扩展?
The DBSCAN function of FPC package of R language performs density clustering analysis on data, checks the clustering labels of all samples, and the table function calculates the two-dimensional contin
831. KMP string
Automatic classification of defective photovoltaic module cells in electroluminescence images-論文閱讀筆記
PMP对工作有益吗?怎么选择靠谱平台让备考更省心省力!!!
Dynamic addition of El upload upload component; El upload dynamically uploads files; El upload distinguishes which component uploads the file.
华南X99平台打鸡血教程
Some arrangements about oneself
开源OA开发平台:合同管理使用手册
Open source heavy ware! Chapter 9 the open source project of ylarn causal learning of Yunji datacanvas company will be released soon!
ASP. Net learning & ASP's one word
[confluence] JVM memory adjustment
Redis——基本使用(key、String、List、Set 、Zset 、Hash、Geo、Bitmap、Hyperloglog、事务 )
841. String hash
时间工具类
位运算介绍
Le PGR est - il utile au travail? Comment choisir une plate - forme fiable pour économiser le cœur et la main - d'œuvre lors de la préparation de l'examen!!!
vulnhub之tre1