You are given two nums1 and nums2, both of length n.
In one operation, you can choose an index i such that nums1[i] and nums2[i].
Your task is to find the minimum number of operations required to make nums1[n - 1] equal to the maximum element in nums1 and nums2[n - 1] equal to the maximum element in nums2.
Return the minimum number of operations needed to satisfy both conditions, or
Constraints:
nums1.length nums2.length
nums1[i]
nums2[i]
You are given two nums1 and nums2, both of length n.
In one operation, you can choose an index i such that nums1[i] and nums2[i].
Your task is to find the minimum number of operations required to make nums1[n - 1] equal to the maximum element in nums1 and nums2[n - 1] equal to the maximum element in nums2.
Return the minimum number of operations needed to satisfy both conditions, or
Constraints:
nums1.length nums2.length
nums1[i]
nums2[i]