I have two vectors A,B and I want to merge them to a vector C but I want to preserve any duplicates in each vector while discarding duplicates between the two.
For example if I have A{1,2,3,4,2,5} and B{7,8,2,2,2,3,3} I want C to be {1,2,2,2,3,3,4,5,7,8}. It doesn't need to be sorted. A and B can be sorted vectors if it's required.
What I have tried:
set_difference and set_symmetric_difference