Skip to main content

Practice ยท 3 of 4

Group and count

CHALLENGE
Difficulty: beginner+25 XP

Implement static Dictionary<string, int> CountByFirstLetter(IEnumerable<string> words) โ€” group words by char.ToLowerInvariant(word[0]) as key; and static Dictionary<int, int> CountByLength(IEnumerable<string> words) โ€” group by length. Null/empty input โ†’ empty dictionaries.

Back to lesson: Practice: LINQ workout