You are given array A of N integers and an integer S.Your task is to compute how many ways one can choose a sub-array that has arithmetic mean equal to S.
-10^9 <= A[i] <= 10^9
 ,[1,3] , [2,1,3]
Any help would be highly appreciated . Better than O(N*N)