FPEvalRepoPublic/LeetCodeMetaData
0399
1{2 "id": 2634,3 "name": "minimum-common-value",4 "difficulty": "Easy",5 "link": "https://leetcode.com/problems/minimum-common-value/",6 "date": "2023-01-07",7 "task_description": "Given two integer arrays `nums1` and `nums2`, sorted in non-decreasing order, return _the **minimum integer common** to both arrays_. If there is no common integer amongst `nums1` and `nums2`, return `-1`. Note that an integer is said to be **common** to `nums1` and `nums2` if both arrays have **at least one** occurrence of that integer. **Example 1:** ``` **Input:** nums1 = [1,2,3], nums2 = [2,4] **Output:** 2 **Explanation:** The smallest element common to both arrays is 2, so we return 2. ``` **Example 2:** ``` **Input:** nums1 = [1,2,3,6], nums2 = [2,3,4,5] **Output:** 2 **Explanation:** There are two common elements in the array 2 and 3 out of which 2 is the smallest, so 2 is returned. ``` **Constraints:** `1 <= nums1.length, nums2.length <= 105` `1 <= nums1[i], nums2[j] <= 109` Both `nums1` and `nums2` are sorted in **non-decreasing** order.",8 "test_case": [9 {10 "label": "Example 1",11 "input": "nums1 = [1,2,3], nums2 = [2,4]",12 "output": "2 "13 },14 {15 "label": "Example 2",16 "input": "nums1 = [1,2,3,6], nums2 = [2,3,4,5]",17 "output": "2 "18 }19 ],20 "constraints": [21 "1 <= nums1.length, nums2.length <= 105",22 "1 <= nums1[i], nums2[j] <= 109",23 "Both nums1 and nums2 are sorted in non-decreasing order."24 ],25 "python_template": "class Solution(object):\n def getCommon(self, nums1, nums2):\n \"\"\"\n :type nums1: List[int]\n :type nums2: List[int]\n :rtype: int\n \"\"\"\n ",26 "java_template": "class Solution {\n public int getCommon(int[] nums1, int[] nums2) {\n \n }\n}",27 "metadata": {28 "func_name": "getCommon"29 }30}