Class Solution
java.lang.Object
g2601_2700.s2605_form_smallest_number_from_two_digit_arrays.Solution
2605 - Form Smallest Number From Two Digit Arrays.<p>Easy</p>
<p>Given two arrays of <strong>unique</strong> digits <code>nums1</code> and <code>nums2</code>, return <em>the <strong>smallest</strong> number that contains <strong>at least</strong> one digit from each array</em>.</p>
<p><strong>Example 1:</strong></p>
<p><strong>Input:</strong> nums1 = [4,1,3], nums2 = [5,7]</p>
<p><strong>Output:</strong> 15</p>
<p><strong>Explanation:</strong> The number 15 contains the digit 1 from nums1 and the digit 5 from nums2. It can be proven that 15 is the smallest number we can have.</p>
<p><strong>Example 2:</strong></p>
<p><strong>Input:</strong> nums1 = [3,5,2,6], nums2 = [3,1,7]</p>
<p><strong>Output:</strong> 3</p>
<p><strong>Explanation:</strong> The number 3 contains the digit 3 which exists in both arrays.</p>
<p><strong>Constraints:</strong></p>
<ul>
<li><code>1 <= nums1.length, nums2.length <= 9</code></li>
<li><code>1 <= nums1[i], nums2[i] <= 9</code></li>
<li>All digits in each array are <strong>unique</strong>.</li>
</ul>
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Solution
public Solution()
-
-
Method Details
-
minNumber
public int minNumber(int[] nums1, int[] nums2)
-