python binary search
\nclass Solution(object):\n    def maxDistance(self, nums1, nums2):\n        """\n        :type nums1: List[int]\n        :type nums2: List[int]\n        :rtype
```\nclass Solution(object):\n    def maxDistance(self, nums1, nums2):\n        """\n        :type nums1: List[int]\n        :type nums2: List[int]\n        :rtype: int\n        """\n        res = 0\n        n1 = len(nums1)\n        n2 = len(nums2)\n        \n        \n        for i in range(min(n1, n2)):\n            if nums1[i] > nums2[i]:\n                continue\n            left = i\n            right = n2 - 1\n            \n            iv = nums1[i]\n            \n            while left <= right:\n                mid = (left + right) / 2\n                if nums2[mid] >= iv:\n                    left = mid + 1\n                elif nums2[mid] < iv:\n                    right = mid - 1\n            \n            res = max(res, left - i - 1)\n            \n        return res\n            \n```
[]