How to remove common values from two array lists
Here is an algorithm that you could follow to accomplish the task: Construct a union of the two arrays Construct the intersection of the two arrays Subtract the intersection from the union to get your result Java collections support addAll, removeAll, and retainAll. Use addAll to construct unions, retainAll for constructing intersections, and removeAll for … Read more