Largest Triangle Area LeetCode solution in Python
1from itertools import combinations234class Solution:5def largestTriangleArea(self, points: List[List[int]]) -> float:6maxA = 07for p1, p2, p3 in combinations(points, 3):8x1, y1 = p19x2, y2 = p210x3, y3 = p311A = (1 / 2) * abs(x1 * (y2 - y3) + x2 * (y3 - y1) + x3 * (y1 - y2))12if A > maxA:13maxA = A14return maxA