If second occurrence
else if ( rem_1 [ 1 ] == - 1 ) { rem_1 [ 1 ] = i ; } } } if ( rem_1 [ 0 ] != - 1 && rem_1 [ 1 ] != - 1 ) { removeAndPrintResult ( arr , n , rem_1 [ 0 ] , rem_1 [ 1 ] ) ; return true ; } } System . out . print ( " Not ▁ possible " ) ; return false ; } static int accumulate ( int [ ] arr , int start , int end ) { int sum = 0 ; for ( int i = 0 ; i < arr . length ; i ++ ) { sum += arr [ i ] ; } return sum ; }