【Leetcode】1037. Valid Boomerang

【Leetcode】1037. Valid Boomerang_第1张图片

class Solution(object):
    def isBoomerang(self, points):
        """
        use multiply intstead of division
        """
        point1 = points[0]
        point2 = points[1]
        point3 = points[2]
        return not (point1[1] - point2[1])*(point1[0] - point3[0]) ==  (point1[1] - point3[1]) * (point1[0] - point2[0])

你可能感兴趣的:(LeetCode)