Each pair [x, y] in points gives a distinct point in the coordinate plane. Return the largest number of these points that lie on one straight line. Lines may be horizontal, vertical, or slanted; points need not be evenly spaced.
The drawn line connects a largest collinear group of points.
Example 1:
Input: points = [[2,0],[2,4],[2,-3],[5,1]]
Output: 3Explanation: Three points have x-coordinate 2, so they lie on the vertical line x = 2. The fourth point is outside that line.
Example 2:
Input: points = [[0,1],[2,1],[5,1],[1,4]]
Output: 3Explanation: Three points have y-coordinate 1, placing them on the horizontal line y = 1. The remaining point is not on it.
Example 3:
Input: points = [[0,0],[1,2],[3,6],[2,3]]
Output: 3Explanation: The points (0,0), (1,2), and (3,6) satisfy y = 2x. Their spacing differs, but all three lie on the same line; (2,3) does not.
Constraints:
1 <= points.length <= 300- Each point contains exactly two integer coordinates.
-10000 <= points[i][j] <= 10000- All points are distinct.