Print result according to the following conditions
if ( count == 0 ) { document . write ( " " ) ; } else if ( count == N - 1 ) { document . write ( N - 1 ) ; } else if ( count == 1 && arr [ 0 ] <= arr [ N - 1 ] ) { document . write ( index + 1 ) ; }