当前位置:网站首页>力扣1037. 有效的回旋镖
力扣1037. 有效的回旋镖
2022-07-06 17:22:00 【秀强】
题目
给定一个数组 points ,其中 points[i] = [xi, yi] 表示 X-Y 平面上的一个点,如果这些点构成一个 回旋镖 则返回 true 。
回旋镖 定义为一组三个点,这些点 各不相同 且 不在一条直线上 。
来源:力扣(LeetCode)
链接:https://leetcode.cn/problems/valid-boomerang
向量叉乘

代码
class Solution {
public boolean isBoomerang(int[][] points) {
// 向量叉乘
return (points[0][0] - points[1][0]) * (points[1][1] - points[2][1]) - (points[0][1] - points[1][1]) * (points[1][0] - points[2][0]) != 0;
}
}
边栏推荐
- 深度学习之环境配置 jupyter notebook
- Set (generic & list & Set & custom sort)
- Learn to use code to generate beautiful interface documents!!!
- In rails, when the resource creation operation fails and render: new is called, why must the URL be changed to the index URL of the resource?
- UI control telerik UI for WinForms new theme - vs2022 heuristic theme
- C9高校,博士生一作发Nature!
- Provincial and urban level three coordinate boundary data CSV to JSON
- Advantages and disadvantages of code cloning
- 【JokerのZYNQ7020】AXI_ EMC。
- Part V: STM32 system timer and general timer programming
猜你喜欢
![[HFCTF2020]BabyUpload session解析引擎](/img/db/6003129bc16f943ad9868561a2d5dc.png)
[HFCTF2020]BabyUpload session解析引擎

Slam d'attention: un slam visuel monoculaire appris de l'attention humaine

城联优品入股浩柏国际进军国际资本市场,已完成第一步

Data type of pytorch tensor
![[C language] dynamic address book](/img/e7/ca1030a1099fe1f59f5d8dd722fdb7.jpg)
[C language] dynamic address book

第五篇,STM32系统定时器和通用定时器编程
做微服务研发工程师的一年来的总结

Building a dream in the digital era, the Xi'an station of the city chain science and Technology Strategy Summit ended smoothly

Service asynchronous communication

详解OpenCV的矩阵规范化函数normalize()【范围化矩阵的范数或值范围(归一化处理)】,并附NORM_MINMAX情况下的示例代码
随机推荐
There is an error in the paddehub application
Trace tool for MySQL further implementation plan
Batch obtain the latitude coordinates of all administrative regions in China (to the county level)
Cause of handler memory leak
Openjudge noi 1.7 08: character substitution
[batch dos-cmd command - summary and summary] - string search, search, and filter commands (find, findstr), and the difference and discrimination between find and findstr
[Niuke] b-complete square
Building a dream in the digital era, the Xi'an station of the city chain science and Technology Strategy Summit ended smoothly
Data processing of deep learning
第七篇,STM32串口通信编程
动态规划思想《从入门到放弃》
Link sharing of STM32 development materials
Pytorch中torch和torchvision的安装
Leetcode (547) - number of provinces
深度学习之环境配置 jupyter notebook
Dynamic planning idea "from getting started to giving up"
mysql: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such
腾讯云 WebShell 体验
ZABBIX 5.0: automatically monitor Alibaba cloud RDS through LLD
第六篇,STM32脉冲宽度调制(PWM)编程