carloscn / carloscn/structstudy

leetcode1232:缀点成线(check-if-it-is-a-straight-line)

Open
#197 2 comments 0 reactions 1 assignee Claimed by @carloscn View on GitHub
Lang-rust Level-easy 一般问题 数学 数组
Dominant language
C
Stars
4
Forks
1
PR merge metrics
No merged PRs in 30d

Description

### 问题描述

给定一个数组 coordinates ,其中 coordinates[i] = [x, y] , [x, y] 表示横坐标为 x、纵坐标为 y 的点。请你来判断,这些点是否在该坐标系中属于同一条直线上。

示例 1:

![image](https://user-images.githubusercontent.com/16836611/233812562-f6e034d9-f7bb-4001-9ad5-c6baa8cd6ba8.png)

输入:coordinates = [[1,2],[2,3],[3,4],[4,5],[5,6],[6,7]]
输出:true

示例 2:

![image](https://user-images.githubusercontent.com/16836611/233812564-627a04d3-73d3-4051-a80f-7b3dc940fd03.png)

输入:coordinates = [[1,1],[2,2],[3,4],[4,5],[5,6],[7,7]]
输出:false
 

提示:

2 <= coordinates.length <= 1000
coordinates[i].length == 2
-10^4 <= coordinates[i][0], coordinates[i][1] <= 10^4
coordinates 中不含重复的点

来源:力扣(LeetCode)
链接:https://leetcode.cn/problems/check-if-it-is-a-straight-line
著作权归领扣网络所有。商业转载请联系官方授权,非商业转载请注明出处。

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.