Given an array of size n and an integer k, find number of possible subarrays such that sum of there elements is less than or equal to k. Constraints:
Answers
Answered by
0
Step-by-step explanation:
Examples:
Input : arr[] = {1, 2, 1, 0, 1, 1, 0}, k = 4 Output : 5 Explanation: {1, 2, 1} => sum = 4, length = 3 {1, 2, 1, 0}, {2, 1, 0, 1} => sum = 4, length = 4 {1, 0, 1, 1, 0} =>5 sum = 3, length = 5
Similar questions