how to iterater map of sets in c 2b 2b

Solutions on MaxInterview for how to iterater map of sets in c 2b 2b by the best coders in the world

showing results for - "how to iterater map of sets in c 2b 2b"
Ida
24 Apr 2019
1    map<string, set<string>> mp;
2     for (auto const& pair : mp) {
3         cout << pair.first << ": ";
4         for (auto const& elem : pair.second) {
5             cout << elem << ", ";
6         }
7         cout << "\n";
8     }