[Python] Sliding Window - 5 Lines
Iterate on input array \'nums1\'.\nStart with a size-1 shift on \'nums2\'\n\nTime O(n + m)\nSpace O(1)\n\n\nclass Solution:\n    def maxDistance(self, nums1: Li
Iterate on input array \'nums1\'.\nStart with a size-1 shift on \'nums2\'\n\nTime O(n + m)\nSpace O(1)\n\n```\nclass Solution:\n    def maxDistance(self, nums1: List[int], nums2: List[int]) -> int:\n        shift = 1\n        for i, num1 in enumerate(nums1):\n            while i + shift < len(nums2) and num1 <= nums2[i + shift]:\n                shift += 1\n        return shift - 1\n```
[]