You are given an array of positive integers nums of length n.
A pair of non negative integer arrays (arr1, arr2) of length n is defined as monotonic if:
arr1 is non decreasing, which means arr1[0] arr1[1] arr1[n - 1].
arr2 is non increasing, which means arr2[0] arr2[1] arr2[n - 1].
arr1[i] + arr2[i] nums[i] for every index i such that
Return the count of monotonic pairs of arrays (arr1, arr2). Because the answer may be very large, return it modulo
Constraints:
nums.length
nums[i]
You are given an array of positive integers nums of length n.
A pair of non negative integer arrays (arr1, arr2) of length n is defined as monotonic if:
arr1 is non decreasing, which means arr1[0] arr1[1] arr1[n - 1].
arr2 is non increasing, which means arr2[0] arr2[1] arr2[n - 1].
arr1[i] + arr2[i] nums[i] for every index i such that
Return the count of monotonic pairs of arrays (arr1, arr2). Because the answer may be very large, return it modulo
Constraints:
nums.length
nums[i]