There is a map
with map<string, vector<string>> buses;
structure, and I have a string
, so I need to find out how to check string
contains in map
vector.
string stop;
cin >> stop;
if (buses.find(stop) != buses.end()) {
cout << "Yes";
} else {
cout << "No";
}
When I get a stop
string I need to check is there in map's values (not keys, to be more precise in map.second) a string equals to stop
string, if yes I need to print out all the keys containing stop
element in values. { {"bus#1", {"stop#1", "stop#2", "stop#3"}}, ... }