You are given two nums1 and nums2, both sorted in nonincreasing order.
A pair of indices (i, j) is considered valid if i nums1.length, j nums2.length, i j, and nums1[i] nums2[j]. The distance of this pair is j i.
Return the maximum distance of any valid pair (i, j). If no valid pairs exist, return
Constraints:
nums1.length, nums2.length
nums1[i], nums2[j]
Both nums1 and nums2 are sorted in nonincreasing order.
You are given two nums1 and nums2, both sorted in nonincreasing order.
A pair of indices (i, j) is considered valid if i nums1.length, j nums2.length, i j, and nums1[i] nums2[j]. The distance of this pair is j i.
Return the maximum distance of any valid pair (i, j). If no valid pairs exist, return
Constraints:
nums1.length, nums2.length
nums1[i], nums2[j]
Both nums1 and nums2 are sorted in nonincreasing order.