当前位置:网站首页>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
边栏推荐
- Browse the purpose of point setting
- JVM GC垃圾回收简述
- mysql 的一些重要知识
- 国家网信办公布《数据出境安全评估办法》:累计向境外提供10万人信息需申报
- 开源OA开发平台:合同管理使用手册
- 整型int的拼接和拆分
- CUDA versions are inconsistent, and errors are reported when compiling apex
- 第二十章 使用工作队列管理器(三)
- R language uses ggplot2 function to visualize the histogram distribution of counting target variables that need to build Poisson regression model, and analyzes the feasibility of building Poisson regr
- Semantic slam source code analysis
猜你喜欢
Chapter 9 Yunji datacanvas was rated as 36 krypton "the hard core technology enterprise most concerned by investors"
小试牛刀之NunJucks模板引擎
整型int的拼接和拆分
模拟实现string类
Leetcode force buckle (Sword finger offer 36-39) 36 Binary search tree and bidirectional linked list 37 Serialize binary tree 38 Arrangement of strings 39 Numbers that appear more than half of the tim
The state cyberspace Office released the measures for data exit security assessment: 100000 information provided overseas needs to be declared
九章云极DataCanvas公司摘获「第五届数字金融创新大赛」最高荣誉!
BI的边界:BI不适合做什么?主数据、MarTech?该如何扩展?
Some important knowledge of MySQL
LeetCode_7_5
随机推荐
【Auto.js】自动化脚本
Ucloud is a basic cloud computing service provider
R language ggplot2 visualization: use the ggviolin function of ggpubr package to visualize the violin diagram, set the palette parameter to customize the filling color of violin diagrams at different
R language uses ggplot2 function to visualize the histogram distribution of counting target variables that need to build Poisson regression model, and analyzes the feasibility of building Poisson regr
Open source heavy ware! Chapter 9 the open source project of ylarn causal learning of Yunji datacanvas company will be released soon!
A pot of stew, a collection of common commands of NPM and yarn cnpm
Some arrangements about oneself
第二十章 使用工作队列管理器(三)
LeetCode_ 7_ five
R语言dplyr包mutate_at函数和min_rank函数计算dataframe中指定数据列的排序序号值、名次值、将最大值的rank值赋值为1
R language ggplot2 visualization: use the ggqqplot function of ggpubr package to visualize the QQ graph (Quantitative quantitative plot)
IP tools
R语言ggplot2可视化:使用ggpubr包的ggqqplot函数可视化QQ图(Quantile-Quantile plot)
华南X99平台打鸡血教程
TS快速入门-泛型
R language dplyr package mutate_ At function and min_ The rank function calculates the sorting sequence number value and ranking value of the specified data column in the dataframe, and assigns the ra
tp6 实现佣金排行榜
CUDA versions are inconsistent, and errors are reported when compiling apex
el-upload上传组件的动态添加;el-upload动态上传文件;el-upload区分文件是哪个组件上传的。
多个线程之间如何协同