|
3 | 3 | importjava.util.ArrayList;
|
4 | 4 | importjava.util.List;
|
5 | 5 |
|
6 |
| -/** |
7 |
| - * 1213. Intersection of Three Sorted Arrays |
8 |
| - * |
9 |
| - * Given three integer arrays arr1, arr2 and arr3 sorted in strictly increasing order, |
10 |
| - * return a sorted array of only the integers that appeared in all three arrays. |
11 |
| - * |
12 |
| - * Example 1: |
13 |
| - * Input: arr1 = [1,2,3,4,5], arr2 = [1,2,5,7,9], arr3 = [1,3,4,5,8] |
14 |
| - * Output: [1,5] |
15 |
| - * Explanation: Only 1 and 5 appeared in the three arrays. |
16 |
| - * |
17 |
| - * Constraints: |
18 |
| - * |
19 |
| - * 1 <= arr1.length, arr2.length, arr3.length <= 1000 |
20 |
| - * 1 <= arr1[i], arr2[i], arr3[i] <= 2000 |
21 |
| - * */ |
22 | 6 | publicclass_1213 {
|
23 | 7 | publicstaticclassSolution1 {
|
24 |
| -/**credit: https://leetcode.com/problems/intersection-of-three-sorted-arrays/discuss/397603/Simple-Java-solution-beats-100*/ |
| 8 | +/** |
| 9 | + * credit: https://leetcode.com/problems/intersection-of-three-sorted-arrays/discuss/397603/Simple-Java-solution-beats-100 |
| 10 | + */ |
25 | 11 | publicList<Integer>arraysIntersection(int[]arr1,int[]arr2,int[]arr3) {
|
26 | 12 | List<Integer>result =newArrayList();
|
27 | 13 | inti =0;
|
|