当前位置:网站首页>力扣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;
}
}
边栏推荐
- [Batch dos - cmd Command - Summary and Summary] - String search, find, Filter Commands (FIND, findstr), differentiation and Analysis of Find and findstr
- "Exquisite store manager" youth entrepreneurship incubation camp - the first phase of Shunde market has been successfully completed!
- C9 colleges and universities, doctoral students make a statement of nature!
- Data type of pytorch tensor
- Chapter II proxy and cookies of urllib Library
- There is an error in the paddehub application
- Installation and testing of pyflink
- [batch dos-cmd command - summary and summary] - jump, cycle, condition commands (goto, errorlevel, if, for [read, segment, extract string]), CMD command error summary, CMD error
- Equals() and hashcode()
- Link sharing of STM32 development materials
猜你喜欢
Building a dream in the digital era, the Xi'an station of the city chain science and Technology Strategy Summit ended smoothly
[hfctf2020]babyupload session parsing engine
线段树(SegmentTree)
Dr selection of OSPF configuration for Huawei devices
重上吹麻滩——段芝堂创始人翟立冬游记
Learn self 3D representation like ray tracing ego3rt
Chenglian premium products has completed the first step to enter the international capital market by taking shares in halber international
学习光线跟踪一样的自3D表征Ego3RT
Build your own website (17)
Threejs image deformation enlarge full screen animation JS special effect
随机推荐
. Bytecode structure of class file
Periodic flash screen failure of Dell notebook
[force buckle]41 Missing first positive number
Interface (interface related meaning, different abstract classes, interface callback)
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?
Dynamic planning idea "from getting started to giving up"
Telerik UI 2022 R2 SP1 Retail-Not Crack
String comparison in batch file - string comparison in batch file
一行代码实现地址信息解析
代码克隆的优缺点
Distributed cache
学习光线跟踪一样的自3D表征Ego3RT
详解OpenCV的矩阵规范化函数normalize()【范围化矩阵的范数或值范围(归一化处理)】,并附NORM_MINMAX情况下的示例代码
There is an error in the paddehub application
Configuring OSPF basic functions for Huawei devices
Deep understanding of distributed cache design
C9高校,博士生一作发Nature!
How to get started and improve test development?
【批处理DOS-CMD命令-汇总和小结】-字符串搜索、查找、筛选命令(find、findstr),Find和findstr的区别和辨析
[batch dos-cmd command - summary and summary] - view or modify file attributes (attrib), view and modify file association types (Assoc, ftype)