Given an array find number of subarrays of length k in c++
Answers
Answered by
2
Answer:
Number of subarrays having sum exactly equal to k. Given an unsorted array of integers, find the number of subarrays having sum exactly equal to a given number k. Examples: Input : arr[] = {10, 2, -2, -20, 10}, k = -10 Output : 3 Subarrays: arr[0...3], arr[1...4], arr[3..4] have sum exactly equal to -10.
Answered by
1
Answer:
Number of subarrays having sum exactly equal to k. Given an unsorted array of integers, find the number of subarrays having sum exactly equal to a given number k. Examples: Input : arr[] = {10, 2, -2, -20, 10}, k = -10 Output : 3 Subarrays: arr[0..
Similar questions
Social Sciences,
6 months ago
Physics,
6 months ago
Computer Science,
11 months ago
Computer Science,
11 months ago
Math,
1 year ago
Math,
1 year ago