Answer:
ArrayList a contains [2, 3, 3, 3, 4, 5, 3, 2, 1]
Explanation:
Given
The removeValue method
Required
The content of ArrayList a, after the method is called
From the question, we understand that arraylist a is:
The function fails when the value to be removed appear consecutively in the list.
4 appears in index 5 and 6 of the list. Only one of the 4's will be removed
So, the updated list will be: [2, 3, 3, 3, 4, 5, 3, 2, 1]