Given a list of 2D points with integer coordinates, return the maximum number of points that lie on the same straight line.
Input
-
points
: a list of
n
points, where each point is
[x, y]
.
Output
-
An integer: the maximum count of points that are collinear.
Constraints
-
1 <= n <= 2000
-
Coordinates are integers in a reasonable range (e.g.,
[-10^4, 10^4]
).
-
Duplicate points may exist.
Notes
-
Lines can be vertical, horizontal, or any slope.
-
The result should count all points on the best line, including duplicates.