-
-
Save ilpropheta/6dc69f05c91065c77bcccfcaaa56681c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
map<string, int> freq; | |
string curr; | |
while (cin >> curr) | |
{ | |
++freq[curr]; | |
} | |
cout << max_element(begin(freq), end(freq), [](const auto& p1, const auto& p2){ | |
return p1.second < p2.second; | |
})->first; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment