Function to find the maximum count of subarrays
function subarray ( v ) { let n = v . length ; if ( n <= 1 ) { return n ; } let ans = proc ( v ) ; let low = v [ 0 ] , pos_low = 0 , high = v [ 0 ] , pos_high = 0 ;