Practice ยท 2 of 4
Clamp to a range
CHALLENGE
Difficulty: beginner+25 XP
Implement static int Clamp(int value, int min, int max) โ return value when it lies within [min, max], otherwise the boundary it crossed. Both boundaries must be enforced.
Press Submit to check your solution.
Back to lesson: Practice: Method workshop