624. Maximum Distance in Arrays
## 思路
記錄目前遇到的最大最小值
## Code
```python
class Solution:
def maxDistance(self, arrays: List[List[int]]) -> int:
n = len(arrays)
ans = 0
curr_min, curr_max = arrays[0][0], arrays[0][-1]
for i in range(1, n):
ans = max(ans, curr_max - arrays[i][0], arrays[i][-1] - curr_min)
curr_max = max(curr_max, arrays[i][-1])
curr_min = min(curr_min, arrays[i][0])
return ans
```