The Old WaysT
The Old Ways
2h ago

Clamp and Average Solution Fails Despite Correct Result

My solution for clamp and average failed, even when the actual result was the same as expected result. Here is my solution def main(numbers: list[int], minimum: int, maximum: int) -> float: def clamp(number: int) -> int: if number < minimum: return minimum elif number > maximum: return maximum else: return number clamped = [clamp(number) for number in numbers] return round(sum(clamped) / len(clamped), 2)
ProgressIn Progress

changed status toIn Progress·2 hours ago
changed status toReviewing·2 hours ago