Maximum difference of adjacent elements of remaining array
int maxDiff = INT_MIN ; for ( int j = 0 ; j < temp . size ( ) - 1 ; j ++ ) { maxDiff = max ( maxDiff , temp [ j + 1 ] - temp [ j ] ) ; } minDiff = min ( minDiff , maxDiff ) ; } } return minDiff ; }