Practice · 1 of 2
Ordered word counts
CHALLENGE
Difficulty: intermediate+25 XP
Implement std::map<std::string, int> word_counts(const std::vector<std::string>& words) counting occurrences of each word. The returned map must iterate in sorted key order — that ordering is part of the contract, so an unordered_map will fail the sorted test.
Press Submit to check your solution.
Back to lesson: Practice: Associative container problems