What is instability refer to..what it is trying to say cant get it..please give some intution
Hi @hunt
instability refer to the difference of min and max value of array i.e max(arr) - min(arr).
in dis u just have to find out min instability that can be achieved.
eg. array(sorted) = { 1,3,5,9}, instability = 9-1=8. so if u remove 9, instability becomes 5-1=4 and if u remove 1 instability becomes 9-3=6.
u will see that inorder to reduce instability u will always have to remove either min or max of array.
since if u remove other than these 2, eg u remove 3, instability will not change at all and will remain 9-1=8.
Hope dis helps.