#include <iostream>
#include <vector>
std::vector<std::string> getUniqueBrands(const std::vector<std::string>& brand1, const std::vector<std::string>& brand2)
{
std::vector<std::string>res;
for(auto element : brand2)
{
if(element!="PRADA")
res.push_back(element);
}
for(auto element : brand1)
{
if(element!="HERMES")
res.push_back(element);
}
return res;
}
int main()
{
std::vector<std::string> brand1 = {"LOUIS_VUITTON", "HERMES", "PRADA"};
std::vector<std::string> brand2 = {"GUCCI", "PRADA", "HERMES"};
std::vector<std::string> result = getUniqueBrands(brand1, brand2);
for(auto element : result)
{
std::cout << element << ' '; // should print GUCCI HERMES LOUIS_VUITTON PRADA
}
}
Comments
Leave a comment