#include <iostream>
#include <string>
#include <set>
#include <map>
#include <algorithm>
struct cmp {
bool operator()(std::string i, const std::pair<std::string,std::string>& p) const
{
return i < p.first;
}
bool operator()(const std::pair<std::string, std::string>& p, std::string i) const
{
return p.first < i;
}
};
int main(){
std::set<std::string> s1 {"--name", "--id"}; //Conditionally defined mandatory parameters
std::map<std::string, std::string> s2 { {"--name","Admin"}, {"--group","Group1"}}; //options given by user
std::set<std::string> result;
std::set_difference(s1.begin(), s1.end(), s2.begin(), s2.end(),
std::inserter(result, result.end()), cmp());
std::cout << *result.begin() << '\n';
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgojaW5jbHVkZSA8c2V0PgojaW5jbHVkZSA8bWFwPgojaW5jbHVkZSA8YWxnb3JpdGhtPgoKCnN0cnVjdCBjbXAgewogICBib29sIG9wZXJhdG9yKCkoc3RkOjpzdHJpbmcgaSwgY29uc3Qgc3RkOjpwYWlyPHN0ZDo6c3RyaW5nLHN0ZDo6c3RyaW5nPiYgcCkgY29uc3QKICAgewogICAgIHJldHVybiBpIDwgcC5maXJzdDsKICAgfQoKICAgYm9vbCBvcGVyYXRvcigpKGNvbnN0IHN0ZDo6cGFpcjxzdGQ6OnN0cmluZywgc3RkOjpzdHJpbmc+JiBwLCBzdGQ6OnN0cmluZyBpKSBjb25zdAogICB7CiAgICAgcmV0dXJuIHAuZmlyc3QgPCBpOwogICB9Cn07CgppbnQgbWFpbigpewoKICAgICBzdGQ6OnNldDxzdGQ6OnN0cmluZz4gczEgeyItLW5hbWUiLCAiLS1pZCJ9OyAgICAgIC8vQ29uZGl0aW9uYWxseSBkZWZpbmVkIG1hbmRhdG9yeSBwYXJhbWV0ZXJzCiAgICAgc3RkOjptYXA8c3RkOjpzdHJpbmcsIHN0ZDo6c3RyaW5nPiBzMiB7IHsiLS1uYW1lIiwiQWRtaW4ifSwgeyItLWdyb3VwIiwiR3JvdXAxIn19OyAgICAgIC8vb3B0aW9ucyBn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