Find the maximum element in the array other than a [ i ]
for ( int i = 0 ; i < n ; i ++ ) { if ( i == 0 ) Console . Write ( suf [ i + 1 ] + " ▁ " ) ; else if ( i == n - 1 ) Console . Write ( pre [ i - 1 ] + " ▁ " ) ; else Console . Write ( Math . Max ( pre [ i - 1 ] , suf [ i + 1 ] ) + " ▁ " ) ; } }