class Solution:
def maxWidthOfVerticalArea(self, points: List[List[int]]) -> int:
n = len(points)
res = 0
for i in range(1, n):
x1 = points[i][0]
for j in range(i):
x2 = points[j][0]
hasPoints = False
for k in range(n):
if k == i or k == j:
continue
x3 = points[k][0]
if x3 > min(x1, x2) and x3 < max(x1, x2):
hasPoints = True
break
if not hasPoints:
res = max(res, abs(x1 - x2))
return resclass Solution:
def maxWidthOfVerticalArea(self, points: List[List[int]]) -> int:
points.sort()
res = 0
for i in range(len(points) - 1):
res = max(res, points[i + 1][0] - points[i][0])
return res