leetcode1232

1 class Solution:
2     def checkStraightLine(self, coordinates: List[List[int]]) -> bool:
3         (u, v), (p, q) = coordinates[: 2]
4         for x, y in coordinates:
5             if (x - u) * (y - q) != (x - p) * (y - v):
6                 return False
7         return True
原文地址:https://www.cnblogs.com/asenyang/p/11711171.html