Python || Two Pointers
Please upvote if it helps. Thank you!\n\nclass Solution:\n    def maxDistance(self, nums1: List[int], nums2: List[int]) -> int:\n        i, j, max_dist = 0, 0, 
**Please upvote if it helps. Thank you!**\n```\nclass Solution:\n    def maxDistance(self, nums1: List[int], nums2: List[int]) -> int:\n        i, j, max_dist = 0, 0, 0\n        for j in range(len(nums2)):\n            if nums1[i] > nums2[j]:\n                i += 1\n                if i == len(nums1):\n                    break\n            else:\n                max_dist = max(max_dist, j - i)\n        return max_dist\n```
['Two Pointers', 'Python']