最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

LeetCode 2605. Form Smallest Number From Two Digit Arrays

2023-04-02 08:54 作者:您是打尖兒還是住店呢  | 我要投稿

Given two arrays of?unique?digits?nums1?and?nums2, return?the?smallest?number that contains?at least?one digit from each array.

?

Example 1:

Input: nums1 = [4,1,3], nums2 = [5,7]

Output: 15

Explanation: 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.

Example 2:

Input: nums1 = [3,5,2,6], nums2 = [3,1,7]

Output: 3

Explanation: The number 3 contains the digit 3 which exists in both arrays.

?

Constraints:

  • 1 <= nums1.length, nums2.length <= 9

  • 1 <= nums1[i], nums2[i] <= 9

  • All digits in each array are?unique.

easy 題目,如果有相同的元素就返回那個(gè)元素,如果沒(méi)有就用2個(gè)元素的最小值組成的數(shù)字去返回即可;

Runtime:?1 ms, faster than?100.00%?of?Java?online submissions for?Form Smallest Number From Two Digit Arrays.

Memory Usage:?40.8 MB, less than?100.00%?of?Java?online submissions for?Form Smallest Number From Two Digit Arrays.


LeetCode 2605. Form Smallest Number From Two Digit Arrays的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國(guó)家法律
北辰区| 鞍山市| 泸溪县| 皮山县| 舟山市| 蕲春县| 静宁县| 承德市| 乌兰浩特市| 城步| 新疆| 关岭| 阿拉善右旗| 丰原市| 高台县| 台南县| 贺兰县| 沐川县| 济宁市| 新昌县| 榕江县| 邵武市| 绍兴市| 澎湖县| 武定县| 会理县| 建湖县| 海兴县| 吉隆县| 德庆县| 康平县| 潜江市| 南丰县| 五寨县| 西林县| 定襄县| 墨玉县| 清丰县| 济南市| 毕节市| 乐东|