stakes[i] = [x, y] gives the position of stake i on the plane. He wants to run a rope between them and fence off a triangular flower bed.
That only works if the three stakes are at distinct points and do not all lie on one straight line. Return True if so, and False otherwise.stakes=[[0, 0], [4, 0], [1, 3]] → True
The stakes do not lie on one line, so they form a real triangle.
stakes=[[2, 1], [4, 2], [8, 4]] → False
All three points lie on the line y = x / 2.
stakes=[[5, 5], [5, 5], [9, 0]] → False
Two stakes are in the same spot, so there is no triangle.
stakes=[[0, 0], [4, 0], [1, 3]]
True
Run checks the first 3 tests in your browser. Submit checks all 114 tests on the server, hidden ones included.