LeetCode149. Max Points on a Line
LeetCode149. Max Points on a LineQuestion:
Given n points on a 2D plane, find the maximum number of points that lie on the same straight line.
思路:
遍历所有的点,分别计算每个点与其他点的斜率,将这些斜率存储在一个map中并统计数量,最后比较出最大的那
原创
2017-03-29 14:54:26 ·
215 阅读 ·
0 评论