python binary search
Intuition\n\n\n1) nums1 = [30,29,19,5], nums2 = [25,25,25,25,25]\n2) convert to negative values\nnums1 = [-30,-29,-19,-5]\nnums2 = [-25,-25,-25,-25,-25]\n3) ite
Intuition\n\n\n1) nums1 = [30,29,19,5], nums2 = [25,25,25,25,25]\n2) convert to negative values\nnums1 = [-30,-29,-19,-5]\nnums2 = [-25,-25,-25,-25,-25]\n3) iterate nums1 and compare each element with nums2\ni = 0: num1[0]= -30 =>   j = 0 because -30 is smaller than all nums2\ni = 1: num1[1]=-29 =>   j = 0 because -29 is smaller than all nums2\ni = 2: num1[2]=-19 =>   j = 5 because -19 is greater than all nums2\ni = 3 num1[3]=-5 =>  j = 5 because -5 is greater than all nums2\n\n\n```\n    def maxDistance(self, nums1: List[int], nums2: List[int]) -> int:\n\n        nums2 = [-1 * i for i in nums2]\n\n        best = 0\n        for i, n in enumerate(nums1):\n            j = bisect.bisect_right(nums2, -n)\n            if j >= i:\n                best = max(best, j - i - 1)\n\n        return best\n\n```
[]