Grokking LinkedIn Coding Interview
Ask Author
Back to course home

0% completed

Max Points on a Line (hard)
Table of Contents

Contents are not accessible

Contents are not accessible

Contents are not accessible

Contents are not accessible

Contents are not accessible

Problem Statement

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

Examples

  • Example 1:

    • Input: points = [[1,2], [3,6], [5,10], [7,14]]
    • Expected Output: 4
    • Justification: All points lie on the line (y = 2x), forming a straight line with all given points.
  • Example 2:

    • Input: points = [[1,1], [2,2], [3,3], [8,10]]
    • Expected Output: 3

.....

.....

.....

Like the course? Get enrolled and start learning!

Table of Contents

Contents are not accessible

Contents are not accessible

Contents are not accessible

Contents are not accessible

Contents are not accessible