Practice ยท 4 of 4
Max with a constraint
CHALLENGE
Difficulty: beginner+25 XP
Implement static T MaxOf<T>(IEnumerable<T> items) where T : IComparable<T> returning the largest element; throws InvalidOperationException for null or empty input.
Press Submit to check your solution.
Back to lesson: Practice: Generics workout