Skip to content

Commit f72f396

Browse files
committed
daily
1 parent 1d7c21f commit f72f396

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

my-submissions/e812.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)