You are given two positive integer arrays, nums1 and nums2, both of length n. Your task is to count and return the number of pairs of indexes (i,j) where:
In simpler terms, the sum of two elements from nums1 must be greater than that of the corresponding elements from nums2.
Constraints:
n= nums1.length = nums2.length
1≤n≤103
1≤ nums1[i], nums2[i] ≤104
A brute force approach would involve iterating through all pairs (i,j) using nested loops. For each pair:
Compute ...