Trains the technique from
LeetCode 149Max Points on a LineThis is an original problem, written from a brief that listed the technique, the difficulty, the topics, the function shape and the input bounds — none of that problem's wording, examples, hints or editorials. The link is there so you can map your practice onto the standard set.
Same function shape, different story and different numbers.
Pin positions are given as points, each [x, y], and all of them are different.
Return the greatest number of pins that lie on a single straight line.
Example 1
The pins at 2 and 7, 4 and 11, and 6 and 15 all lie on one line, climbing two across and four up each step, so three pins share it and no line holds more.
Example 2
All four pins sit in one column, which is a straight line.
Example 3
A single pin lies on a line of its own.
The editor is preloaded with this. It matches the parent problem's shape, so a solution that works here transfers to a judge unchanged.
def max_points(points: list[list[int]]) -> int:public int maxPoints(int[][] points)See the step-by-step animation, the intuition, and clean code in every language — free, no credit card.