Company: Publicis Sapient(DS role)_22nov
Difficulty: medium
Subarray Partition Problem Description Implement a function that determines the maximum number of non-overlapping, contiguous subarrays in an array arr of length n, that satisfy the following constraints: Each subarray must contain at least minLen elements. The sum of elements in each subarray must be greater than or equal to threshold. The function numSubarrays takes the following inputs: int arr[n]: the array to partition int minLen: the minimum number of elements required in each valid subarray long threshold: the minimum sum required for a subarray to be considered valid The function should return an integer denoting the maximum number of valid subarrays that can be formed without any overlap and satisfying the given constraints. Examples Example 1: Input: arr = [5, 7, 9, 12, 10, 13], minLen = 2, threshold = 15 Output: 2 Explanation: An optimal way of splitting the array into valid subarrays is (using 0-based indexing): The first valid subarray is from index 1 to 3 ([7, 9, 12]), wi