We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1d7c21f commit f72f396Copy full SHA for f72f396
my-submissions/e812.py
@@ -0,0 +1,12 @@
1
+class Solution:
2
+ def largestTriangleArea(self, points: List[List[int]]) -> float:
3
+ area = lambda x, y, z: abs(
4
+ 0.5 * (x[0] * (y[1] - z[1]) + y[0] * (z[1] - x[1]) + z[0] * (x[1] - y[1]))
5
+ )
6
+ output = 0
7
+ for i, p1 in enumerate(points[:-2]) :
8
+ for j, p2 in enumerate(points[i + 1:-1], i + 1) :
9
+ for k, p3 in enumerate(points[j + 1:], j + 1) :
10
+ output = max(output, area(p1, p2, p3))
11
+
12
+ return output
0 commit comments