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

 

posted on 2019-10-21 00:24  Sempron2800+  阅读(123)  评论(0编辑  收藏  举报