0149. Max Points on a Line

https://leetcode.com/problems/max-points-on-a-line

Description

Given an array of points where points[i] = [xi, yi] represents a point on the X-Y plane, return the maximum number of points that lie on the same straight line.

Example 1:

Example 2:

Constraints:

  • 1 <= points.length <= 300

  • points[i].length == 2

  • -104 <= xi, yi <= 104

  • All the points are unique.

ac

GCD calculation

Last updated

Was this helpful?