Easy 2-Pointer Solution
\n    def maxDistance(self, nums1: List[int], nums2: List[int]) -> int:\n        m, n = len(nums1), len(nums2)\n        i = j = 0\n        ans = 0\n        whil
```\n    def maxDistance(self, nums1: List[int], nums2: List[int]) -> int:\n        m, n = len(nums1), len(nums2)\n        i = j = 0\n        ans = 0\n        while i < m and j < n:\n            while j < n and nums1[i] <= nums2[j]:\n                j += 1\n            ans = max(ans, j - i - 1)\n            while i < m and j < n and not (nums1[i] <= nums2[j]):\n                i += 1\n        return ans\n```
[]