Search
⌘K

Leetcode 149. Max Points on a Line

Given up to 300 unique 2D points, return the maximum number that lie on the same straight line. The core challenge is grouping points by slope from each pivot (handling vertical lines and slope precision) to compute the answer in O(n^2) time using normalized slope keys.

Asked at:

Google

Google


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Mid January, 2025

Google

Google

Mid-level

Given a list of points representing cakes on a table, where each point is [x, y, l] (x and y are coordinates, l is length and height of the cake), find a horizontal line such that the line divides the cakes into equal portions above and below it

Comments

Your account is free and you can post anonymously if you choose.