Class Solution

  • All Implemented Interfaces:

    
    public final class Solution
    
                        

    149 - Max Points on a Line.

    Hard

    Given an array of points where <code>pointsi = x<sub>i</sub>, y<sub>i</sub></code> represents a point on the X-Y plane, return the maximum number of points that lie on the same straight line.

    Example 1:

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

    Output: 3

    Example 2:

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

    Output: 4

    Constraints:

    • 1 &lt;= points.length &lt;= 300

    • points[i].length == 2

    • <code>-10<sup>4</sup><= x<sub>i</sub>, y<sub>i</sub><= 10<sup>4</sup></code>

    • All the points are unique.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
      Solution()
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final Integer maxPoints(Array<IntArray> points)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait