Is this official test case output is right for problem " Max Points on a Line"


  • 0
    Z

    When I write my code for problem “Max Points on a Line” , I found the some wrong test case result for this problem!
    This is output for my result:
    Submission Result: Wrong Answer
    Input: [(0,0),(1,1),(0,0)]
    Output: 2
    Expected: 3

    U can see the input [(0,0),(1,1),(0,0)] has same (0,0) points ,so u can’t count them for twice .in fact this the result for max points in same line should be 2((0,0) (1,1)) and not 3 !

    Because u will never found diffrent (0,0) points in same line !


  • 0
    M

    For this problem, we need to count identical points as well in the total.


  • 0
    Z

    let's done by this suggestion to check another input :
    Input: [(84,250),(0,0),(1,0),(0,-70),(0,-70),(1,-1),(21,10),(42,90),(-42,-230)]
    Output: 5
    Expected: 6

    it think only(84,250) ,(0,-70),(0,-70),(42,90),(-42,-230) in same line ,can u found the sixth point ?
    i think the official result is wrong for this input.


Log in to reply
 

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