Class Solution

  • All Implemented Interfaces:

    
    public final class Solution
    
                        

    812 - Largest Triangle Area\.

    Easy

    Given an array of points on the X-Y plane points where <code>pointsi = x<sub>i</sub>, y<sub>i</sub></code>, return the area of the largest triangle that can be formed by any three different points. Answers within <code>10<sup>-5</sup></code> of the actual answer will be accepted.

    Example 1:

    Input: points = \[\[0,0],0,1,1,0,0,2,2,0]

    Output: 2.00000

    Explanation: The five points are shown in the above figure. The red triangle is the largest.

    Example 2:

    Input: points = \[\[1,0],0,0,0,1]

    Output: 0.50000

    Constraints:

    • 3 &lt;= points.length &lt;= 50

    • <code>-50 <= x<sub>i</sub>, y<sub>i</sub><= 50</code>

    • All the given points are unique.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
      Solution()
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final Double largestTriangleArea(Array<IntArray> points)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait