[
geometry
math
]
Leetcode 1037. Valid Boomerang
Problem statement
https://leetcode.com/problems/valid-boomerang/
Solution
Just check that area of triangle is not equal to 0
Complexity
Time and space complexity is O(1)
.
Code
class Solution:
def isBoomerang(self, P):
return (P[2][1]-P[0][1])*(P[1][0]-P[0][0]) != (P[1][1]-P[0][1])*(P[2][0]-P[0][0])