Computer Science, asked by RamKumar3216, 11 months ago

Given an array find number of subarrays of length k in c++

Answers

Answered by ItsCuteBoy
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 Anonymous
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