mengli / leetcode

leetcode
190 stars 121 forks source link

What about the y intercept? #3

Closed LarryBattle closed 9 years ago

LarryBattle commented 10 years ago

I enjoyed reading your code for MaxPointsOnALine.java URL: https://github.com/mengli/leetcode/blob/master/MaxPointsOnALine.java#L30

After reviewing your code, it seems that it's only comparing the slope value and not including calculation for the x or y intercepts. However, shouldn't you include that in your comparisons since two different lines can have the same slope but different x or y intercepts.

mengli commented 9 years ago

Fixed. Thanks!