Skip to content

Commit 5a313b6

Browse files
add 2605
1 parent 63acd06 commit 5a313b6

File tree

2 files changed

+25
-0
lines changed
  • paginated_contents/algorithms/3rd_thousand
  • src/main/java/com/fishercoder/solutions/thirdthousand

2 files changed

+25
-0
lines changed

Diff for: paginated_contents/algorithms/3rd_thousand/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
| 2670 | [Find the Distinct Difference Array](https://leetcode.com/problems/find-the-distinct-difference-array/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/thirdthousand/_2670.java) | | Easy |
2222
| 2643 | [Row With Maximum Ones](https://leetcode.com/problems/row-with-maximum-ones/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/thirdthousand/_2643.java) | | Easy |
2323
| 2641 | [Cousins in Binary Tree II](https://leetcode.com/problems/cousins-in-binary-tree-ii/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/thirdthousand/_2641.java) | | Medium |Tree, BFS, HashTable
24+
| 2605 | [Form Smallest Number From Two Digit Arrays](https://leetcode.com/problems/form-smallest-number-from-two-digit-arrays/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/thirdthousand/_2605.java) | | Easy |
2425
| 2600 | [K Items With the Maximum Sum](https://leetcode.com/problems/k-items-with-the-maximum-sum/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/thirdthousand/_2600.java) | | Easy |
2526
| 2596 | [Check Knight Tour Configuration](https://leetcode.com/problems/check-knight-tour-configuration/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/thirdthousand/_2596.java) | [:tv:](https://youtu.be/OBht8NT_09c) | Medium |
2627
| 2595 | [Number of Even and Odd Bits](https://leetcode.com/problems/number-of-even-and-odd-bits/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/thirdthousand/_2595.java) | | Easy |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.fishercoder.solutions.thirdthousand;
2+
3+
import java.util.Arrays;
4+
5+
public class _2605 {
6+
public static class Solution1 {
7+
public int minNumber(int[] nums1, int[] nums2) {
8+
for (int i = 0; i < nums1.length; i++) {
9+
for (int j = 0; j < nums2.length; j++) {
10+
if (nums1[i] == nums2[j]) {
11+
return nums1[i];
12+
}
13+
}
14+
}
15+
Arrays.sort(nums1);
16+
Arrays.sort(nums2);
17+
if (nums1[0] < nums2[0]) {
18+
return nums1[0] * 10 + nums2[0];
19+
} else {
20+
return nums2[0] * 10 + nums1[0];
21+
}
22+
}
23+
}
24+
}

0 commit comments

Comments
 (0)