1 class Solution: 2 def isBoomerang(self, points: 'List[List[int]]') -> bool: 3 l = sorted(points, key = lambda x: (x[0],x[1])) 4 #print(l) 5 c = points[2] 6 b = points[1] 7 a = points[0] 8 if c[0]==b[0] and b[0]==a[0]: 9 return False 10 if c[1]==b[1] and b[1]==a[1]: 11 return False 12 if (c[0]==b[0] and c[1]==b[1]) or (c[0]==a[0] and c[1]==a[1]) or (b[0]==a[0] and b[1]==a[1]): 13 return False 14 if (c[0]==b[0] and b[0]!=a[0]) or (a[0]==c[0] and a[0]!=b[0]) or (a[0]==b[0] and b[0]!= c[0]): 15 return True 16 if (c[1]==b[1] and b[1]!=a[1]) or (a[1]==c[1] and a[1]!=b[1]) or (a[1]==b[1] and b[1]!= c[1]): 17 return True 18 i = c[0]-b[0] 19 j = b[0]-a[0] 20 h = c[1]-b[1] 21 n = b[1]-a[1] 22 if h/i == n/j: 23 return False 24 else: 25 return True