Number of subarray having average sum equal to K

Revision en1, by tuanio, 2021-01-28 18:12:05

Hello guys, i have a question like this. Given an array has length n, n <= 10^7, a[i][j] <= 10^9. Number K <= 10^9. How i can count number of subarray has average sum equal to K. Thanks for your time.

Tags #question

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English tuanio 2021-01-28 18:16:49 3 Tiny change: '10^7, a[i][j] <= 10^9.' -> '10^7, a[i] <= 10^9.'
en1 English tuanio 2021-01-28 18:12:05 248 Initial revision (published)