当前位置:网站首页>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
边栏推荐
- 力扣 1037.有效的回旋镖
- 力扣599. 两个列表的最小索引总和
- How to buy stocks on your mobile phone and open an account? Is it safe to open an account
- 一锅乱炖,npm、yarn cnpm常用命令合集
- pom.xml 配置文件标签作用简述
- 剑指 Offer II 013. 二维子矩阵的和
- Make this crmeb single merchant wechat mall system popular, so easy to use!
- 力扣 459. 重复的子字符串
- R语言ggplot2可视化:使用ggpubr包的ggviolin函数可视化小提琴图、设置palette参数自定义不同水平小提琴图的填充色、add参数在小提琴图添加箱图
- 一文读懂数仓中的pg_stat
猜你喜欢

剑指 Offer II 013. 二维子矩阵的和

干货分享|DevExpress v22.1原版帮助文档下载集合
![[RT thread env tool installation]](/img/bc/9b39651d40a240f0893200793f67e9.png)
[RT thread env tool installation]

MRS离线数据分析:通过Flink作业处理OBS数据

Open source heavy ware! Chapter 9 the open source project of ylarn causal learning of Yunji datacanvas company will be released soon!

LeetCode_ 7_ five

ASP. Net kindergarten chain management system source code

Implement secondary index with Gaussian redis

BI的边界:BI不适合做什么?主数据、MarTech?该如何扩展?

el-upload上传组件的动态添加;el-upload动态上传文件;el-upload区分文件是哪个组件上传的。
随机推荐
位运算介绍
Automatic classification of defective photovoltaic module cells in electroluminescence images-论文阅读笔记
PMP对工作有益吗?怎么选择靠谱平台让备考更省心省力!!!
PMP practice once a day | don't get lost in the exam -7.7
RESTAPI 版本控制策略【eolink 翻译】
多个线程之间如何协同
力扣 1232.缀点成线
Throughput
力扣 643. 子数组最大平均数 I
力扣 1961. 检查字符串是否为数组前缀
Nunjuks template engine
让这个 CRMEB 单商户微信商城系统火起来,太好用了!
CUDA versions are inconsistent, and errors are reported when compiling apex
一锅乱炖,npm、yarn cnpm常用命令合集
R language dplyr package select function, group_ The by function, filter function and do function obtain the third largest value of a specific numerical data column in a specified level in a specified
Redis——基本使用(key、String、List、Set 、Zset 、Hash、Geo、Bitmap、Hyperloglog、事务 )
ASP.NET体育馆综合会员管理系统源码,免费分享
Semantic slam source code analysis
力扣 2315.统计星号
Le PGR est - il utile au travail? Comment choisir une plate - forme fiable pour économiser le cœur et la main - d'œuvre lors de la préparation de l'examen!!!