I created two maps in Java that contain the same type of Keys and Values:
Map<Position,Movement> A;
Map<Position,Movement> B;
I want to remove from them both (not create a new Map) the keys that are the same. I don't care if the value is different or not. For example, if A has Position: a2, Movement: n,n and B has Position: a2, Movement: 1,2 those entries should be removed.
I wonder if there is a fast way to do that without iterating the shortest map and compare every single key.
Thanks