Problem
You are given points, where points[i] = [x, y] is a point on a flat plane with integer coordinates. No two points are the same. Return the largest number of points that lie on one straight line.
Example 1
- Input
- points = [[0, 0], [2, 2], [5, 5], [1, 3]]
- Output
- 3
- Why
- the line y = x
Example 2
- Input
- points = [[0, 0], [1, 2], [2, 4], [3, 0], [0, 3]]
- Output
- 3
Example 3
- Input
- points = [[7, 7]]
- Output
- 1
Constraints
1 <= points.length <= 300-10^4 <= x, y <= 10^4All points are distinct.