Practice ยท 1 of 2
Ordered word counts
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.
Difficulty: intermediate
Press Submit to check your solution.
Back to lesson: Practice: Associative container problems