当前位置:网站首页>Force buckle 1037 Effective boomerang
Force buckle 1037 Effective boomerang
2022-07-07 01:08:00 【Xiu Qiang】
subject
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 .
source : Power button (LeetCode)
link :https://leetcode.cn/problems/valid-boomerang
Vector cross product
Code
class Solution {
public boolean isBoomerang(int[][] points) {
// Vector cross product
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;
}
}
边栏推荐
- golang中的atomic,以及CAS操作
- 第五篇,STM32系统定时器和通用定时器编程
- [batch dos-cmd command - summary and summary] - view or modify file attributes (attrib), view and modify file association types (Assoc, ftype)
- Learning notes 5: ram and ROM
- tensorflow 1.14指定gpu运行设置
- MySQL中回表的代价
- Chapter 5 DML data operation
- 一行代码实现地址信息解析
- Data processing of deep learning
- What is time
猜你喜欢
Batch obtain the latitude coordinates of all administrative regions in China (to the county level)
Building a dream in the digital era, the Xi'an station of the city chain science and Technology Strategy Summit ended smoothly
【批处理DOS-CMD命令-汇总和小结】-跳转、循环、条件命令(goto、errorlevel、if、for[读取、切分、提取字符串]、)cmd命令错误汇总,cmd错误
Periodic flash screen failure of Dell notebook
第六篇,STM32脉冲宽度调制(PWM)编程
重上吹麻滩——段芝堂创始人翟立冬游记
Linear algebra of deep learning
界面控件DevExpress WinForms皮肤编辑器的这个补丁,你了解了吗?
Niuke cold training camp 6B (Freund has no green name level)
批量获取中国所有行政区域经边界纬度坐标(到县区级别)
随机推荐
第六篇,STM32脉冲宽度调制(PWM)编程
View remote test data and records anytime, anywhere -- ipehub2 and ipemotion app
Set (generic & list & Set & custom sort)
Build your own website (17)
Make a simple graphical interface with Tkinter
New feature of Oracle 19C: automatic DML redirection of ADG, enhanced read-write separation -- ADG_ REDIRECT_ DML
Cause of handler memory leak
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?
Anfulai embedded weekly report no. 272: 2022.06.27--2022.07.03
Windows installation mysql8 (5 minutes)
[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
[hfctf2020]babyupload session parsing engine
Fastdfs data migration operation record
Come on, don't spread it out. Fashion cloud secretly takes you to collect "cloud" wool, and then secretly builds a personal website to be the king of scrolls, hehe
fastDFS数据迁移操作记录
Js+svg love diffusion animation JS special effects
UI control telerik UI for WinForms new theme - vs2022 heuristic theme
腾讯云 WebShell 体验
在jupyter中实现实时协同是一种什么体验
Oracle:CDB限制PDB资源实战