java.lang.Object
g1601_1700.s1637_widest_vertical_area_between_two_points_containing_no_points.Solution

public class Solution extends Object
1637 - Widest Vertical Area Between Two Points Containing No Points.<p>Medium</p> <p>Given <code>n</code> <code>points</code> on a 2D plane where <code>points[i] = [x<sub>i</sub>, y<sub>i</sub>]</code>, Return_ the <strong>widest vertical area</strong> between two points such that no points are inside the area._</p> <p>A <strong>vertical area</strong> is an area of fixed-width extending infinitely along the y-axis (i.e., infinite height). The <strong>widest vertical area</strong> is the one with the maximum width.</p> <p>Note that points <strong>on the edge</strong> of a vertical area <strong>are not</strong> considered included in the area.</p> <p><strong>Example 1:</strong></p> <p><img src="https://assets.leetcode.com/uploads/2020/09/19/points3.png" alt="" /></p> <p><strong>Input:</strong> points = [[8,7],[9,9],[7,4],[9,7]]</p> <p><strong>Output:</strong> 1</p> <p><strong>Explanation:</strong> Both the red and the blue area are optimal.</p> <p><strong>Example 2:</strong></p> <p><strong>Input:</strong> points = [[3,1],[9,0],[1,0],[1,4],[5,3],[8,8]]</p> <p><strong>Output:</strong> 3</p> <p><strong>Constraints:</strong></p> <ul> <li><code>n == points.length</code></li> <li><code>2 <= n <= 10<sup>5</sup></code></li> <li><code>points[i].length == 2</code></li> <li><code>0 <= x<sub>i</sub>, y<sub>i</sub> <= 10<sup>9</sup></code></li> </ul>
  • Constructor Details

    • Solution

      public Solution()
  • Method Details

    • maxWidthOfVerticalArea

      public int maxWidthOfVerticalArea(int[][] points)