Practice ยท 2 of 4
CountIf with a predicate
CHALLENGE
Difficulty: beginner+25 XP
Implement static int CountIf<T>(IEnumerable<T> items, Func<T, bool> predicate) counting matching elements; null items โ 0.
Press Submit to check your solution.
Back to lesson: Practice: Generics workout