Python || Easy to understand || Binary Search || with extra func
\ndef maxDistance(self, nums1: List[int], nums2: List[int]) -> int:\n               \n        \n        def check(target, idx):\n            l, r = 0, len(nums2
```\ndef maxDistance(self, nums1: List[int], nums2: List[int]) -> int:\n               \n        \n        def check(target, idx):\n            l, r = 0, len(nums2)\n            while l<r:\n                m=(l+r)//2\n                if nums2[m]>=target:\n                    l=m+1\n                else:\n                    r=m\n            return l-1\n        \n        dic={}\n        for i in range(len(nums1)):\n            dic[i]=check(nums1[i],i)\n        print(dic)\n        \n        res=0\n        for i in range(len(dic)):\n            if dic[i]-i>res:\n                res=dic[i]-i\n        return res\n    \n```
['Binary Tree', 'Python']