```
class Solution:
# @param points, a list of Points
# @return an integer
def gcd(self, a, b):
if a < b:
a, b = b, a
while b != 0:
temp = a % b
a = b
b = temp
return a
def slope(self, l):
if l[0]**2 + l[1]**2 == 0:
return '0 0'
else:
g = self.gcd(l[0], l[1])
r = [l[0]/g, l[1]/g]
if r[0]<0:
r = [-i for i in r]
return ' '.join([str(r[0]), str(r[1])])
def maxPoints(self, points):
if len(points) <= 2:
return len(points)
m = 0
while len(points) >= 2:
center = points.pop()
slope = [self.slope([p.x - center.x, p.y - center.y]) for p in points]
times = {}
ztimes = 0
for s in slope:
if s == '0 0':
ztimes += 1
elif s in times:
times[s] += 1
else:
times[s] = 1
if times:
n = ztimes + max(times.values()) + 1
else:
n = ztimes + 1
if m < n:
m = n
return m
```