Utility function that puts all non - positive ( 0 and negative ) numbers on left side of arr [ ] and return count of such numbers
function segregate ( arr , size ) { let j = 0 , i ; for ( i = 0 ; i < size ; i ++ ) { if ( arr [ i ] <= 0 ) { let temp ; temp = arr [ i ] ; arr [ i ] = arr [ j ] ; arr [ j ] = temp ;