Skip to main content

Practice · 1 of 1

Sort Pairs by Second

CHALLENGE
Difficulty: beginner+25 XP

Implement by_second(pairs): return a new vector of std::pair<std::string,int> sorted by the int (ascending); ties keep alphabetical order of the string.

Back to lesson: Practice: Lambda Practice: Custom Keys