Complete the following Java method that accepts an ArrayList ofInteger objects. It should return a new copy of the list with alladjacent duplicate values removed;
e.g. 1 1 1 3 7 4 4 2 12 8 8 9 1 15 1 -6 -6
Becomes:
1 3 7 4 2 12 8 9 1 15 1 -6
Return the duplicate-free list. Do not modify the original listin any way. You may assume that the list contains only Integerobjects.
public static ArrayList removeDuplicate(ArrayList list) { ….}
Please use comments
Expert Answer
An answer will be send to you shortly. . . . .