Number of subarrays with sum exactly = k.

Правка en1, от a_journey, 2019-02-05 15:17:25

Given an array a[] = {1, 1 ,1 , -1} . you have to find all the subarrays of the given array whose sum is exactly = ****k.

There is an geeks_article for it but the explanation is not

good and clear and also without proof . Can anyone explain me how to solve this problem with some explanation !

Thanks !

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en5 Английский a_journey 2019-02-05 15:22:55 11 Tiny change: ' 1 , -1 } \n\nAns =' -> ' 1 , -1 } and k = 1 \n\nAns ='
en4 Английский a_journey 2019-02-05 15:20:39 81
en3 Английский a_journey 2019-02-05 15:18:17 6
en2 Английский a_journey 2019-02-05 15:17:44 4 Tiny change: 'xactly =_ ****k.\n\n\nTh' -> 'xactly =_ k.\n\n\nTh'
en1 Английский a_journey 2019-02-05 15:17:25 430 Initial revision (published)