Given an integer array nums and an integer k, determine the total number of partitions of nums into contiguous non empty subarrays such that for every subarray, the difference between its maximum element and its minimum element is at most k.
Constraints:
nums.length
nums[i]
k
Given an integer array nums and an integer k, determine the total number of partitions of nums into contiguous non empty subarrays such that for every subarray, the difference between its maximum element and its minimum element is at most k.
Constraints:
nums.length
nums[i]
k