Check Straight Line
Return True if all the points in coordinates lie on one straight line (a line of any direction, including vertical), otherwise False. One or two points always lie on a line.
Example 1
coordinates [[1,2],[2,3],[3,4],[4,5]]
returns true
All on y = x + 1.
Constraints
1 <= len(coordinates) <= 20- Points are distinct, coordinates between -100 and 100
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.