Easy java8 sollution


#1

public class Solution {

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

}


#2

We just defeated the entire existence of Two Pointer Approach

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


#3

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.