You are given two nums1 and nums2, both of length n.
A pair of indices (i, j) is considered valid if i to index j inclusive in nums1 is equal to the sum of the elements from index i to index j inclusive in nums2.
The distance between the pair of indices (i, j) is defined as
Return the maximum distance of a valid pair of indices (i, j). If there are no valid pairs of indices, return
Constraints:
n nums1.length nums2.length
n
nums1[i] is either
nums2[i] is either
You are given two nums1 and nums2, both of length n.
A pair of indices (i, j) is considered valid if i to index j inclusive in nums1 is equal to the sum of the elements from index i to index j inclusive in nums2.
The distance between the pair of indices (i, j) is defined as
Return the maximum distance of a valid pair of indices (i, j). If there are no valid pairs of indices, return
Constraints:
n nums1.length nums2.length
n
nums1[i] is either
nums2[i] is either