2022-03-27 20:37:52 +08:00
|
|
|
|
<p>给定一个数组 <code>coordinates</code> ,其中 <code>coordinates[i] = [x, y]</code> ,<meta charset="UTF-8" /> <code>[x, y]</code> 表示横坐标为 <code>x</code>、纵坐标为 <code>y</code> 的点。请你来判断,这些点是否在该坐标系中属于同一条直线上。</p>
|
|
|
|
|
|
|
|
|
|
<p> </p>
|
|
|
|
|
|
2023-12-09 18:42:21 +08:00
|
|
|
|
<p><strong class="example">示例 1:</strong></p>
|
2022-03-27 20:37:52 +08:00
|
|
|
|
|
|
|
|
|
<p><img alt="" src="https://assets.leetcode-cn.com/aliyun-lc-upload/uploads/2019/10/19/untitled-diagram-2.jpg" /></p>
|
|
|
|
|
|
|
|
|
|
<pre>
|
|
|
|
|
<strong>输入:</strong>coordinates = [[1,2],[2,3],[3,4],[4,5],[5,6],[6,7]]
|
|
|
|
|
<strong>输出:</strong>true
|
|
|
|
|
</pre>
|
|
|
|
|
|
2023-12-09 18:42:21 +08:00
|
|
|
|
<p><strong class="example">示例 2:</strong></p>
|
2022-03-27 20:37:52 +08:00
|
|
|
|
|
|
|
|
|
<p><strong><img alt="" src="https://assets.leetcode-cn.com/aliyun-lc-upload/uploads/2019/10/19/untitled-diagram-1.jpg" /></strong></p>
|
|
|
|
|
|
|
|
|
|
<pre>
|
|
|
|
|
<strong>输入:</strong>coordinates = [[1,1],[2,2],[3,4],[4,5],[5,6],[7,7]]
|
|
|
|
|
<strong>输出:</strong>false
|
|
|
|
|
</pre>
|
|
|
|
|
|
|
|
|
|
<p> </p>
|
|
|
|
|
|
|
|
|
|
<p><strong>提示:</strong></p>
|
|
|
|
|
|
|
|
|
|
<ul>
|
|
|
|
|
<li><code>2 <= coordinates.length <= 1000</code></li>
|
|
|
|
|
<li><code>coordinates[i].length == 2</code></li>
|
|
|
|
|
<li><code>-10^4 <= coordinates[i][0], coordinates[i][1] <= 10^4</code></li>
|
|
|
|
|
<li><code>coordinates</code> 中不含重复的点</li>
|
|
|
|
|
</ul>
|