Tap here to switch tabs
Problem
Submissions

Problem: Minimum Common Value

med
30 min
Try to solve the Minimum Common Value problem.

Statement

Given two integer arrays nums1 and nums2, sorted in nondecreasing order, return the minimum integer value that is common to both arrays. If there is no common integer between them, return −1-1.

Constraints:

  • 1≤1 \leq nums1.length, nums2.length ≤105\leq 10^5

  • 1≤1 \leq nums1[i], nums2[j] ≤109\leq 10^9

  • Both nums1 and nums2 are sorted in nondecreasing order.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Minimum Common Value

med
30 min
Try to solve the Minimum Common Value problem.

Statement

Given two integer arrays nums1 and nums2, sorted in nondecreasing order, return the minimum integer value that is common to both arrays. If there is no common integer between them, return −1-1.

Constraints:

  • 1≤1 \leq nums1.length, nums2.length ≤105\leq 10^5

  • 1≤1 \leq nums1[i], nums2[j] ≤109\leq 10^9

  • Both nums1 and nums2 are sorted in nondecreasing order.