Function that count the length of longest subarray with product greater than or equals to zero
function maxLength ( arr , N ) { var product = 1 , len = 0 ; for ( var i = 0 ; i < N ; i ++ ) { product *= arr [ i ] ; }