Question PRG-CPP-0062
HardWhat is the output of this program?
#include <iostream>
#include <string>
#include <unordered_map>
using namespace std;
int main() {
unordered_map<string, int> m;
for (string w : {"a", "b", "a", "c", "a", "b"}) m[w]++;
cout << m["a"] << m["b"] << m["c"] << m.size();
return 0;
}
- A.
3213
- B.
3212
- C.
Sign up free to see the answer and a step-by-step explanation.