ByteByteGo logo
menuProblems List

Maximum Collinear Points

Hard

Given a set of points in a two-dimensional plane, determine the maximum number of points that lie along the same straight line.

Example:

Input: points = [[1, 1], [1, 3], [2, 2], [3, 1], [3, 3], [4, 4]]
Output: 4

Constraints:

  • The input won't contain duplicate points.

You can practice coding exercises online by logging into bytebytego.com on your laptop.