| 62 | } |
| 63 | |
| 64 | size_t maxWordLength(const WordCounts& wordCounts) |
| 65 | { |
| 66 | size_t max{}; |
| 67 | for (const auto& [word, count] : wordCounts) |
| 68 | if (count >= 2 && max < word.length()) max = word.length(); |
| 69 | return max; |
| 70 | } |
| 71 | |
| 72 | void showWordCounts(const WordCounts& wordCounts) |
| 73 | { |