#1637
Widest Vertical Area Between Two Points Containing No Points
newbie · 175 · lc easy +15 · verified · 87.1% accepted · 983 likes · top 98%
Description
Given n points on a 2D plane, find the widest gap between two consecutive x-coordinates (ignoring y-values) such that no other point lies within that gap. Points on the boundary are not considered inside the area. Return the maximum such width.
Example 1:
Input: points = [[8,7],[9,9],[7,4],[9,7]]
Output: 1
Explanation: Both the red and the blue area are optimal.
Example 2:
Input: points = [[3,1],[9,0],[1,0],[1,4],[5,3],[8,8]]
Output: 3
Code
1
2
3