当前位置:网站首页>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
边栏推荐
- R语言ggplot2可视化:使用ggpubr包的ggqqplot函数可视化QQ图(Quantile-Quantile plot)
- 【STL】vector
- 开源重器!九章云极DataCanvas公司YLearn因果学习开源项目即将发布!
- 九章云极DataCanvas公司摘获「第五届数字金融创新大赛」最高荣誉!
- 【Auto.js】自动化脚本
- R语言dplyr包mutate_at函数和min_rank函数计算dataframe中指定数据列的排序序号值、名次值、将最大值的rank值赋值为1
- RESTAPI 版本控制策略【eolink 翻译】
- R语言dplyr包select函数、group_by函数、filter函数和do函数获取dataframe中指定因子变量中指定水平中特定数值数据列的值第三大的值
- PMP practice once a day | don't get lost in the exam -7.7
- 毕业季|遗憾而又幸运的毕业季
猜你喜欢

Interpretation of transpose convolution theory (input-output size analysis)
Make this crmeb single merchant wechat mall system popular, so easy to use!

整型int的拼接和拆分

CSDN syntax description

九章云极DataCanvas公司摘获「第五届数字金融创新大赛」最高荣誉!

9 原子操作类之18罗汉增强

ASP. Net learning & ASP's one word

干货分享|DevExpress v22.1原版帮助文档下载集合

YoloV6:YoloV6+Win10---训练自己得数据集

数据孤岛是企业数字化转型遇到的第一道险关
随机推荐
强化学习-学习笔记8 | Q-learning
IP tools
CUDA versions are inconsistent, and errors are reported when compiling apex
Introduction to bit operation
PMP对工作有益吗?怎么选择靠谱平台让备考更省心省力!!!
Redis——基本使用(key、String、List、Set 、Zset 、Hash、Geo、Bitmap、Hyperloglog、事务 )
Make this crmeb single merchant wechat mall system popular, so easy to use!
Cloud 组件发展升级
JVM GC garbage collection brief
el-upload上传组件的动态添加;el-upload动态上传文件;el-upload区分文件是哪个组件上传的。
注解。。。
论文解读(ValidUtil)《Rethinking the Setting of Semi-supervised Learning on Graphs》
Tp6 realize Commission ranking
ASP. Net gymnasium integrated member management system source code, free sharing
831. KMP string
Force buckle 674 Longest continuous increasing sequence
力扣 1790. 仅执行一次字符串交换能否使两个字符串相等
力扣 1037.有效的回旋镖
TS快速入门-泛型
sql 常用优化