Only 2 tcs passing

#include
#include<unordered_map>
using namespace std;
int main() {
int n;
cin>>n;
int k;
cin>>k;
int arr[n];
int csum[n+1];
csum[0]=0;
for(int i=0;i<n;++i)
{
cin>>arr[i];
csum[i+1]=csum[i]+arr[i];
}
unordered_map<int,int> m;
m[0]=1;
long long cnt=0;
for(int i=1;i<=n;++i)
{
if(m[k-csum[i]])
{
cnt+=m[k-csum[i]];
}
m[csum[i]]++;
}
cout<<cnt;
return 0;
}

hello @Harshrajotiya
pls save ur code at cb ide and paste its url here

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.