Easy java8 sollution


public class Solution {

public void merge(ArrayList<Integer> a, ArrayList<Integer> b) {
    for(int i=0;i<b.size();i++)



We just defeated the entire existence of Two Pointer Approach

Weren’t we supposed to solve it without using the library methods?


they didn’t write anywhere that you cannot use library method. but if you want to solve without library function you can compare element of both arraylist and add it into new one and then add this arraylist to A.