Skip to content

Latest commit

 

History

History
17 lines (15 loc) · 456 Bytes

1637.md

File metadata and controls

17 lines (15 loc) · 456 Bytes

1637. Widest Vertical Area Between Two Points Containing No Points

Solution 1 (time O(nlog(n)), space O(n))

class Solution(object):
    def maxWidthOfVerticalArea(self, points):
        """
        :type points: List[List[int]]
        :rtype: int
        """
        points.sort()
        ans = 0
        for i in range(len(points) - 1):
            ans = max(ans, points[i + 1][0] - points[i][0])
        return ans