leetcode 149. Max Points on a Line

Given n points on a 2D plane, find the maximum number of points that lie on the same straight line.java 法一:兩點肯定一條直線(兩兩組合),而後在判斷其餘點是否在這條直線上,O(n^3)spa 法二:遍歷每個點i {其餘點j與該點i組成直線的斜率xl,斜率相同,統計加1----斜率相同又過同一個
相關文章
相關標籤/搜索