Code: Select all
arr:=[2,3,4,3,4,5,8,6,6,2,7,7,14,8,9,10,12,14,19,13,14,14,21,15,3,4,14,15,16,16,17]
here in this array arr[7] , arr[10] ,arr[13] , arr[19], arr[23], arr[25] , arr[26] are outliers as there is abrupt change in value comparing nearby values.
how can these outlier which are lesser than near by values be increased by borrowing from nearby values and similarly the outlier values which are much higher than near by values be reduced by giving to nearby values.
total sum of the array should not change.
any idea ?