Merge Names

C++ Arrays Public New



Implement the unique_names method. When passed two vectors of names, it will return a vector containing the names that appear in either or both vectors. The returned vector should have no duplicates.

For example, calling unique_names(std::vector<std::string>{"Ava", "Emma", "Olivia"}, std::vector<std::string>{"Olivia", "Sophia", "Emma"}) should return a vector containing Ava, Emma, Olivia, and Sophia in any order.


  •   Example case: Exception
  •   Each vector has distinct names: Exception
  •   Each vector has duplicate names: Exception
  •   Vectors have some names in common: Exception