What is the output of the following code?
#include <iostream>
#include <set>
int main() {
std::multiset<int> s {1, 2, 3, 3, 3, 4, 4, 5};
s.erase(3);
for (auto it = s.begin(); it != s.end(); ++it) {
std::cout << *it << " ";
}
std::cout << std::endl;
return 0;
}1 2 3 4 5
1 2 4 4 5
1 2 4 5
2 4 5
This question is part of this quiz :
C++ Set and Multiset