当前位置:网站首页>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
边栏推荐
- 841. String hash
- Training IX basic configuration of network services
- Chapter 20 using work queue manager (3)
- [confluence] JVM memory adjustment
- el-upload上传组件的动态添加;el-upload动态上传文件;el-upload区分文件是哪个组件上传的。
- 力扣674. 最长连续递增序列
- ASP.NET幼儿园连锁管理系统源码
- Ucloud is a basic cloud computing service provider
- ASP. Net gymnasium integrated member management system source code, free sharing
- R language ggplot2 visualization: use the ggecdf function of ggpubr package to visualize the grouping experience cumulative density distribution function curve, and the linetype parameter to specify t
猜你喜欢
Automatic classification of defective photovoltaic module cells in electroluminescence images-論文閱讀筆記
CSDN syntax description
mysql 的一些重要知识
How to cooperate among multiple threads
项目经理『面试八问』,看了等于会了
Open source heavy ware! Chapter 9 the open source project of ylarn causal learning of Yunji datacanvas company will be released soon!
论文解读(ValidUtil)《Rethinking the Setting of Semi-supervised Learning on Graphs》
ASP.NET幼儿园连锁管理系统源码
el-upload上传组件的动态添加;el-upload动态上传文件;el-upload区分文件是哪个组件上传的。
整型int的拼接和拆分
随机推荐
gorilla官方:golang开websocket client的示例代码
CSDN语法说明
Dynamic addition of El upload upload component; El upload dynamically uploads files; El upload distinguishes which component uploads the file.
MRS离线数据分析:通过Flink作业处理OBS数据
vulnhub之school 1
Version selection of boot and cloud
位运算介绍
Nunjuks template engine
吞吐量Throughout
关于cv2.dnn.readNetFromONNX(path)就报ERROR during processing node with 3 inputs and 1 outputs的解决过程【独家发布】
模拟实现string类
ASP.NET体育馆综合会员管理系统源码,免费分享
【Auto.js】自动化脚本
最多可以参加的会议数目[贪心 + 优先队列]
[auto.js] automatic script
tp6 实现佣金排行榜
Welcome to the markdown editor
mysql 的一些重要知识
ASP. Net gymnasium integrated member management system source code, free sharing
PMP每日一练 | 考试不迷路-7.7