当前位置:网站首页>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;
}
}
边栏推荐
- 新手如何入门学习PostgreSQL?
- OSPF configuration command of Huawei equipment
- Do you understand this patch of the interface control devaxpress WinForms skin editor?
- golang中的Mutex原理解析
- 重上吹麻滩——段芝堂创始人翟立冬游记
- Chenglian premium products has completed the first step to enter the international capital market by taking shares in halber international
- Openjudge noi 1.7 10: simple password
- ARM裸板调试之JTAG原理
- [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
- Deep learning framework TF installation
猜你喜欢
Explain in detail the matrix normalization function normalize() of OpenCV [norm or value range of the scoped matrix (normalization)], and attach norm_ Example code in the case of minmax
做微服务研发工程师的一年来的总结
省市区三级坐标边界数据csv转JSON
筑梦数字时代,城链科技战略峰会西安站顺利落幕
Batch obtain the latitude coordinates of all administrative regions in China (to the county level)
Set (generic & list & Set & custom sort)
【JVM调优实战100例】05——方法区调优实战(下)
View remote test data and records anytime, anywhere -- ipehub2 and ipemotion app
Learn to use code to generate beautiful interface documents!!!
Equals() and hashcode()
随机推荐
线段树(SegmentTree)
Part VI, STM32 pulse width modulation (PWM) programming
Installation of torch and torch vision in pytorch
第四篇,STM32中断控制编程
[hfctf2020]babyupload session parsing engine
[HFCTF2020]BabyUpload session解析引擎
golang中的atomic,以及CAS操作
Address information parsing in one line of code
View remote test data and records anytime, anywhere -- ipehub2 and ipemotion app
[牛客] [NOIP2015]跳石头
Telerik UI 2022 R2 SP1 Retail-Not Crack
Part V: STM32 system timer and general timer programming
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?
MySQL中回表的代价
[software reverse - solve flag] memory acquisition, inverse transformation operation, linear transformation, constraint solving
Dr selection of OSPF configuration for Huawei devices
Batch obtain the latitude coordinates of all administrative regions in China (to the county level)
Set (generic & list & Set & custom sort)
Fastdfs data migration operation record
通过串口实现printf函数,中断实现串口数据接收