Commit 6c729b6
committed
feat: Merge two ArrayLists by pattern List1 + List2 + List1 and print result
🧠 Logic:
- Accepts sizes and elements of two lists from user input.
- Stores elements in `list1` and `list2` using `ArrayList<Integer>`.
- Creates a `mergedList` and adds:
- All elements of `list1`
- Then all elements of `list2`
- Then `list1` again to form the final merged pattern.
- Prints the merged list in a single line.
Signed-off-by: Somesh diwan <[email protected]>1 parent d818eda commit 6c729b6
1 file changed
+17
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | 1 | | |
18 | 2 | | |
19 | 3 | | |
| |||
49 | 33 | | |
50 | 34 | | |
51 | 35 | | |
| 36 | + | |
52 | 37 | | |
53 | 38 | | |
54 | 39 | | |
| |||
59 | 44 | | |
60 | 45 | | |
61 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
0 commit comments