当前位置:网站首页>Force buckle 1232 Dotted line
Force buckle 1232 Dotted line
2022-07-07 20:06:00 【Tomorrowave】
1232. Dotted line
Given an array coordinates , among coordinates[i] = [x, y] , [x, y] The abscissa is x、 Ordinate for y The point of . Please judge , Whether these points belong to the same line in the coordinate system .
Example 1:
Input :coordinates = [[1,2],[2,3],[3,4],[4,5],[5,6],[6,7]]
Output :true
Ideas
Use the product of slope to do
Code section
class Solution:
def checkStraightLine(self, coordinates: List[List[int]]) -> bool:
a=coordinates[1][0]-coordinates[0][0]
b=coordinates[1][1]-coordinates[0][1]
for i in range(2,len(coordinates)):
c = coordinates[i][0] - coordinates[0][0]
d = coordinates[i][1] - coordinates[0][1]
if (a * d - b * c != 0):
return False
return True
边栏推荐
- 数据孤岛是企业数字化转型遇到的第一道险关
- The state cyberspace Office released the measures for data exit security assessment: 100000 information provided overseas needs to be declared
- 第二十章 使用工作队列管理器(三)
- MIT科技评论文章:围绕Gato等模型的AGI炒作可能使人们忽视真正重要的问题
- 注解。。。
- 线性基
- Semantic SLAM源码解析
- 九章云极DataCanvas公司获评36氪「最受投资人关注的硬核科技企业」
- openEuler 有奖捉虫活动,来参与一下?
- 开源OA开发平台:合同管理使用手册
猜你喜欢
How to cooperate among multiple threads
编译器优化那些事儿(4):归纳变量
J ü rgen schmidhub reviews the 25th anniversary of LSTM papers: long short term memory All computable metaverses. Hierarchical reinforcement learning (RL). Meta-RL. Abstractions in generative adversar
开源OA开发平台:合同管理使用手册
Introduction to bit operation
Chapter 9 Yunji datacanvas was rated as 36 krypton "the hard core technology enterprise most concerned by investors"
CSDN syntax description
剑指 Offer II 013. 二维子矩阵的和
九章云极DataCanvas公司获评36氪「最受投资人关注的硬核科技企业」
项目经理『面试八问』,看了等于会了
随机推荐
ASP. Net gymnasium integrated member management system source code, free sharing
Data island is the first danger encountered by enterprises in their digital transformation
【剑指offer】剑指 Offer II 012. 左右两边子数组的和相等
Openeuler prize catching activities, to participate in?
R语言ggplot2可视化:使用ggpubr包的ggstripchart函数可视化分组点状条带图(dot strip plot)、设置position参数配置不同分组数据点的分离程度
【Auto.js】自动化脚本
TS快速入门-泛型
最多可以参加的会议数目[贪心 + 优先队列]
Boot 和 Cloud 的版本选型
841. String hash
J ü rgen schmidhub reviews the 25th anniversary of LSTM papers: long short term memory All computable metaverses. Hierarchical reinforcement learning (RL). Meta-RL. Abstractions in generative adversar
使用高斯Redis实现二级索引
Cuda版本不一致,编译apex报错
力扣674. 最长连续递增序列
Semantic slam source code analysis
Redis——基本使用(key、String、List、Set 、Zset 、Hash、Geo、Bitmap、Hyperloglog、事务 )
pom.xml 配置文件标签:dependencies 和 dependencyManagement 区别
openEuler 资源利用率提升之道 01:概论
Dynamic addition of El upload upload component; El upload dynamically uploads files; El upload distinguishes which component uploads the file.
R language dplyr package mutate_ At function and min_ The rank function calculates the sorting sequence number value and ranking value of the specified data column in the dataframe, and assigns the ra