Is this case wrong?


  • 1
    F

    I submit my solution and the OJ give the Wrong Answer,show the result is

    Input:[(0, 0)]
    Output : 0
    Expected : 1

    question is the input:[(0,0)],if only one point,how could get the maximum number of points that lie on the same straight line?


  • 1
    G

    If there is only one point, of course it is in the same straight line. Two points is the same case. So if the size of the points vector is equal or smaller than 2, then you can return its size.


  • 0
    M

    The problem does not ask for the maximum number of points on a line defined by the points, only the most points a single line could pass through. While there are an infinite number of lines passing through that one point, no line has more than 1 point in the list occurring in it. However, there are certainly lines which do contain that point, so the maximum number of points on a line cannot be 0.


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.