【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.code 解析:题目要求是给定n个2维的点,求出总共有多少个点在同一条直线上。由数学知识可知,给定三个点a,b,c,若是三个点在一条直线上,则a和b的斜率与c和d的斜率是相同的。用哈希表来作,针对
相关文章
相关标签/搜索