For this Question: Given an unsorted array arr[] of N integers and a sum. The task is to count the number of subarrays which adds to a given number.The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. 
Each test case contains an integer N denoting the size of the array and integer denoting the value of the sum in the first line. 
The next line contains N space separated integers forming the array.

Constraints:
1 <= T <= 100
1 <= N <= 10^4
-105 <= arr[i] <= 10^5
-105 <= sum <= 10^5

Note:- Sum of N over all test cases does not exceed 10^5For each testcase, in a new line, print the count of the subarrays which add to the given sum.Sample Input
2
5 -10
10 2 -2 -20 10
6 33
1 4 20 3 10 5

Sample Output
3
1

Explanation:
Testcase 1: Subarrays with sum -10 are: [10, 2, -2, -20], [2, -2, -20, 10] and [-20, 10].
Testcase 2: Subarray with sum 33 is: [20, 3, 10]., I have written this Solution Code: t = int(input())

while(t > 0):
	s = input().split()
	n = int(s[0])
	k = int(s[1])

	li = input().split()
	li = list(map(int, li))

	sum = 0
	d = {}
	count = 0
	for i in range(n):
		sum += li[i]
		if sum == k:
			count += 1
			
		if sum-k in d:
			count += d[sum-k]
		
		if sum not in d:
			d[sum] = 1
		else:
			d[sum] += 1


	print(count)
	t -= 1, In this Programming Language: Python, Now tell me if this Code is compilable or not?