当前位置:网站首页>LeetCode:1037. Effective boomerang - simple
LeetCode:1037. Effective boomerang - simple
2022-06-10 20:49:00 【Kinght_ one hundred and twenty-three】

Catalog
subject
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
Their thinking

- mathematics .
- If three points are collinear , Then the cross product of any two vectors is equal to 0.
Code
class Solution:
def isBoomerang(self, points: List[List[int]]) -> bool:
v1 = (points[1][0] - points[0][0], points[1][1] - points[0][1])
v2 = (points[2][0] - points[0][0], points[2][1] - points[0][1])
return v1[0] * v2[1] - v1[1] * v2[0] != 0
Running results

边栏推荐
- The most common habits from more than 200 English papers written by gradua
- 六级考试-商务英语-考前最后一背
- Li Kou 10821084 solution_ Question of SQL query type
- canvas 高级功能(中)
- The national advanced computing industry innovation (Yichang) center was officially launched and jointly operated by Zhongke Shuguang and Shengzhe technologies
- 电子招标采购商城系统:优化传统采购业务,提速企业数字化升级
- The old programmer said: stop translating the world, developers should return to programming
- 服务管理与通信,基础原理分析
- Knife4j configuration can use direct copy
- knife4j配置使用直接拷贝即可
猜你喜欢

CVPR 2022丨清华大学提出:无监督域泛化 (UDG)
![[observation] shengteng Zhixing: scene driven, innovation first, press the](/img/53/29f5fd8b869087bafbe74849329c84.jpg)
[observation] shengteng Zhixing: scene driven, innovation first, press the "acceleration key" for Intelligent Transportation

pdf. Js----- JS parse PDF file to realize preview, and obtain the contents in PDF file (in array form)

玩艺术也得学数学?

How to realize face verification quickly and accurately?

暗黑破坏神不朽WIKI地址 暗黑破坏神不朽数据库地址分享

在阿里云国际上使用 OSS 和 CDN 部署静态网站

C语言 浮点数 储存形式

自注意力(self-attention)和多头注意力(multi-head attention)
![[FAQ] summary of common problems and solutions during the use of rest API interface of sports health service](/img/9e/9ce804d84fb8ec9221b7c10bbd6c36.jpg)
[FAQ] summary of common problems and solutions during the use of rest API interface of sports health service
随机推荐
农产品期货开户的条件是什么?现在开户的手续费是多少?
synergy: server refused client with our name
获取列表中最大最小值的前n个数值的位置索引的四种方法
How to use Diablo immortal database
中衍期货靠谱吗?是不是正规期货公司?开户安全吗?
vulnhub-The Planets: Earth
Jiangbolong forestee xp2000 PCIe 4.0 SSD multi encryption function, locking data security
Development scheme of 108k humidifier for water replenishment instrument_ Single chip microcomputer_ NY8A051F_ Development of single chip microcomputer
LeetCode:1037. 有效的回旋镖————简单
京东发布基于张量网络加速的大规模、分布式量子机器学习平台TeD-Q
手写代码 bind
User defined date component. The left and right buttons control forward or backward year, month, week and day turning
Fs2117 boost IC output 5v2.4a synchronous rectification
P5723 【深基4.例13】质数口袋
Uni app custom navigation
Elastic-Job的快速入门,三分钟带你体验分布式定时任务
Mixin -- mixed
力扣1082,1084题解_sql查询类型的题目
In depth learning experience and tools
PDF. JS - - - - JS analyse le fichier PDF pour réaliser l'aperçu et obtenir le contenu du fichier PDF (sous forme de tableau)