Hard
You are given grid, where each row is a distinct point [x, y] on the plane. Return the maximum number of points that lie on the same straight line.
Input: grid = [[1,1],[2,2],[3,3]] Output: 3
Input: grid = [[1,1],[3,2],[5,3],[4,1],[2,3],[1,4]] Output: 4