当前位置:网站首页>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;
}
}
边栏推荐
- 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
- Leetcode (547) - number of provinces
- 筑梦数字时代,城链科技战略峰会西安站顺利落幕
- 新手如何入门学习PostgreSQL?
- Atomic in golang and CAS operations
- Deeply explore the compilation and pile insertion technology (IV. ASM exploration)
- 做微服务研发工程师的一年来的总结
- Grc: personal information protection law, personal privacy, corporate risk compliance governance
- How to get started and improve test development?
- 【JVM调优实战100例】05——方法区调优实战(下)
猜你喜欢
. Bytecode structure of class file
Make a simple graphical interface with Tkinter
[Niuke classic question 01] bit operation
【批处理DOS-CMD命令-汇总和小结】-跳转、循环、条件命令(goto、errorlevel、if、for[读取、切分、提取字符串]、)cmd命令错误汇总,cmd错误
[100 cases of JVM tuning practice] 04 - Method area tuning practice (Part 1)
.class文件的字节码结构
ESP Arduino (IV) PWM waveform control output
用tkinter做一个简单图形界面
Data processing of deep learning
Deep understanding of distributed cache design
随机推荐
New feature of Oracle 19C: automatic DML redirection of ADG, enhanced read-write separation -- ADG_ REDIRECT_ DML
MySQL中回表的代价
Learn to use code to generate beautiful interface documents!!!
[牛客] B-完全平方数
Telerik UI 2022 R2 SP1 Retail-Not Crack
Link sharing of STM32 development materials
Atomic in golang, and cas Operations
A brief history of deep learning (II)
Batch obtain the latitude coordinates of all administrative regions in China (to the county level)
Fastdfs data migration operation record
boot - prometheus-push gateway 使用
golang中的atomic,以及CAS操作
[Niuke] [noip2015] jumping stone
【批处理DOS-CMD命令-汇总和小结】-查看或修改文件属性(ATTRIB),查看、修改文件关联类型(assoc、ftype)
Cause of handler memory leak
Dell Notebook Periodic Flash Screen Fault
资产安全问题或制约加密行业发展 风控+合规成为平台破局关键
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?
ARM裸板调试之JTAG原理
View remote test data and records anytime, anywhere -- ipehub2 and ipemotion app