For Type 4 employee
for ( int i = 1 ; i <= n ; i ++ ) { if ( arr . get ( i - 1 ) < arr . get ( i ) && arr . get ( i ) > arr . get ( i + 1 ) ) { hike [ i ] = Math . max ( hike [ i - 1 ] , hike [ i + 1 ] ) + 1 ; } }