stars[i] = [x, y] gives the integer coordinates of the i-th star. All points are distinct.
Return the largest number of stars that lie on a single straight line. The line can be any line: slanted, horizontal or vertical.stars=[[0, 0], [2, 1], [4, 2], [1, 3], [3, 0]] → 3
The stars (0, 0), (2, 1) and (4, 2) lie on one line. No four stars here share a line.
stars=[[-1, 2], [-1, -4], [-1, 0], [3, 3]] → 3
Three stars sit on the vertical line x = -1.
stars=[[5, 5]] → 1
stars=[[0, 0], [2, 1], [4, 2], [1, 3], [3, 0]]
3
Run checks the first 3 tests in your browser. Submit checks all 100 tests on the server, hidden ones included.