Combining two arrays

I wanted to ask if there is a way to combine two arrays without repeating same elements in them, like we have A {1,2,4,6} and B {2,5,6,1} and we get C{1,2,4,5,6}? C++

Does the order matter to you?

Otherwise you add them both to a map or unorderedmap

Or if the order does matter, add them to a map/unordered_map anyway, but also add it to an array/vector only if it wasn’t already present in the map/unordered_map