Maximum value of | arr [ 0 ] | Function to return the maximum required value ; Driver code
< ? php function maxValue ( $ n ) { if ( $ n == 1 ) return 0 ; return ( ( $ n * $ n / 2 ) - 1 ) ; } $ n = 4 ; echo maxValue ( $ n ) ; ? >