pins, where pins[i] = [x, y]. Stretch a thread around three different pins to form a triangle of the largest possible area, and return that area.
If the three pins lie on one line, the triangle has area 0. Answers within 10⁻⁵ of the exact value are accepted.pins=[[0, 0], [4, 0], [1, 1], [0, 3]] → 6.0
The best triangle is (0, 0), (4, 0), (0, 3): a right triangle with legs 4 and 3, area 6.
pins=[[-2, 1], [2, 1], [0, -1]] → 4.0
There are only three pins. The base from (-2, 1) to (2, 1) has length 4 and the height is 2, so the area is 4.
pins=[[1, 1], [2, 2], [3, 3]] → 0
pins=[[0, 0], [4, 0], [1, 1], [0, 3]]
6.0
Run checks the first 3 tests in your browser. Submit checks all 111 tests on the server, hidden ones included.