Function to find the count of negative integers and check if zero exists in the array
function preProcess ( arr , n ) { for ( let i = 0 ; i < n ; i ++ ) { if ( arr [ i ] < 0 ) cnt_neg ++ ; if ( arr [ i ] == 0 ) exists_zero = true ; } }