blob: 710b497c230c1fd3a2d073dedaf5203fdb5b6b7d (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
#!/usr/bin/env python
import typing
class Solution:
def maxWidthOfVerticalArea(self, points: typing.List[typing.List[int]]) -> int:
p: typing.List[int] = []
for point in points:
p.append(point[0])
p.sort()
s = 0
for i in range(1, len(p)):
s = max(p[i] - p[i - 1], s)
return s
def main():
solution = Solution()
points = [[8, 7], [9, 9], [7, 4], [9, 7]]
print(solution.maxWidthOfVerticalArea(points))
if __name__ == "__main__":
main()
|