JavaScript Solution (Easy)
\nvar maxDistance = function(nums1, nums2) {\n    if(nums1[nums1.length - 1] > nums2[0]){\n        return 0\n    }\n    \n    let i = 0, j = 0, maxDistance = 0\
```\nvar maxDistance = function(nums1, nums2) {\n    if(nums1[nums1.length - 1] > nums2[0]){\n        return 0\n    }\n    \n    let i = 0, j = 0, maxDistance = 0\n    \n    while(i < nums1.length){\n        if(j < nums2.length && nums1[i] <= nums2[j]){\n            maxDistance = Math.max(maxDistance, j - i)\n            j++\n        }else{\n            i++\n            j++\n        }\n    }\n    \n    return maxDistance\n};\n```
[]