Simple Python Solution || Beats 99.4%
\n\n\nclass Solution:\n    def maxDistance(self, nums1: List[int], nums2: List[int]) -> int:\n        ptr1,ptr2, result = 0,0,0\n        while ptr1 < len(nums1)
![image](https://assets.leetcode.com/users/images/715925e1-ff20-4bf2-83fb-5b83ecf31046_1660468663.3634741.png)\n\n```\nclass Solution:\n    def maxDistance(self, nums1: List[int], nums2: List[int]) -> int:\n        ptr1,ptr2, result = 0,0,0\n        while ptr1 < len(nums1) and ptr2 < len(nums2):\n            while ptr2 < len(nums2) and nums1[ptr1] <= nums2[ptr2]:\n                ptr2 += 1\n            result = max(result,ptr2-ptr1-1)\n            ptr1 += 1\n        return result\n```
['Two Pointers', 'Python']