阅读背景:

[LeetCode]Maximum number of points on a straight line in 2d plane

来源:互联网 

From Here

Solution:

Remember that a line can be represented by y=kx+d, if p1 and p2 are in same line, then y1=x1k+d, y2=kx2+d, so y2-y1=kx2-kx1, so k=(y2-y1)/(x2-x1), then we can apply this formula to check if two points are in same line, however how to handle the duplicate points problem?Remember that a li




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: