python 2 pointers O(N)
\tclass Solution(object):\n\t\tdef maxDistance(self, nums1, nums2):\n\t\t\t"""\n\t\t\t:type nums1: List[int]\n\t\t\t:type nums2: List[int]\n\t\t\t:rtype: int\n\
\tclass Solution(object):\n\t\tdef maxDistance(self, nums1, nums2):\n\t\t\t"""\n\t\t\t:type nums1: List[int]\n\t\t\t:type nums2: List[int]\n\t\t\t:rtype: int\n\t\t\t"""\n\t\t\tret = 0\n\t\t\ti, j = 0, 0\n\t\t\twhile i < len(nums1) and j < len(nums2):\n\t\t\t\tif nums1[i] <= nums2[j]:\n\t\t\t\t\tret = max(ret, j-i)\n\t\t\t\t\tj += 1\n\t\t\t\telse:\n\t\t\t\t\ti += 1\n\t\t\t\t\tj += 1\n\t\t\treturn ret\n
[]