Načítava sa úloha…
Sometimes an average is easier to trust after removing one unusually large value and one unusually small value. Write a function centered_average that takes a list nums with at least three numbers. Remove one maximum and one minimum value, calculate the average of the remaining numbers, and return it using integer division.
[1, 2, 3, 4, 100]3[1, 1, 5, 5, 10, 8, 7]5[-10, -4, -2, -4, -2, 0]-3def centered_average(nums: list[int]) -> int:
Prihláste sa, aby ste videli históriu odoslaní
Prihlásiť saPrihláste sa, aby ste mohli používať AI mentora
Prihlásiť sa[1,2,3,4,100]3[1,1,5,5,10,8,7]5[-10,-4,-2,-4,-2,0]-3[5,3,4,6,2]4[1,2,3]2[0,0,0,0,0]0