Remove exactly one element from the array such that max | function to calculate max - min ; Driver code
< ? php function max_min ( & $ a , $ n ) { sort ( $ a ) ; return min ( $ a [ $ n - 2 ] - $ a [ 0 ] , $ a [ $ n - 1 ] - $ a [ 1 ] ) ; } $ a = array ( 1 , 3 , 3 , 7 ) ; $ n = sizeof ( $ a ) ; echo ( max_min ( $ a , $ n ) ) ; ? >