Check If It Is a Straight Line
class Solution:
def checkStraightLine(self, coordinates: List[List[int]]) -> bool:
N = len(coordinates)
for ix in range(N - 2):
x1, y1 = coordinates[0 + ix]
x2, y2 = coordinates[1 + ix]
x3, y3 = coordinates[2 + ix]
if (y2 - y1) * (x3 - x2) != (y3 - y2) * (x2 - x1):
return False
return True