xCoords and yCoords, both lists of integers with equal length. Each index i pairs xCoords[i] and yCoords[i] as one two-dimensional drop point.1 < N, M <= 700, where N = len(xCoords) and M = len(yCoords).max_points_on_line([2, 3, 2, 4, 2], [2, 2, 6, 5, 8]) -> 3
xCoords = [2,3, 2, 4, 2] yCoords = [2, 2, 6, 5, 8]
3
| 0 | 1 | 2 | 3 | 4 | |
|---|---|---|---|---|---|
| 0 | • | ||||
| 1 | |||||
| 2 | • | ||||
| 3 | • | ||||
| 4 | |||||
| 5 | |||||
| 6 | • | • | |||
| 7 | |||||
| 8 |
Here are the five drop points plotted on a grid.
The vertical line at x = 2 passes through three drop points, which is more than any other valid horizontal or vertical path.
max_points_on_line([1, 2, 3], [4, 4, 5]) -> 2
The two points whose y-coordinate is 4 lie on the same horizontal path, so two drop points can be covered.
xCoords = [2,3, 2, 4, 2] yCoords = [2, 2, 6, 5, 8]
3
| 0 | 1 | 2 | 3 | 4 | |
|---|---|---|---|---|---|
| 0 | • | ||||
| 1 | |||||
| 2 | • | ||||
| 3 | • | ||||
| 4 | |||||
| 5 | |||||
| 6 | • | • | |||
| 7 | |||||
| 8 |
Here are the five drop points plotted on a grid.