Help me out in this problem

my code is giving error in first case

I am seeing your code…

@mr.encoder it is running fine on leetcode

Have you submitted it on leetcode?

@mr.encoder yes it is passed all test cases

@mr.encoder his code is of number of subarray whose sum=k
sorry i raised doubt in diff ques

This problem says in Input Format
First line contain T test cases. The following T lines contains a String and a integer k each.
And the way you are taking input is taking n k then n elements. Correct this one. And also add an endl line for output format.

Okay so you have raised different question.

I would request you to post another doubt so that I can have link to that question and mark this doubt as resolved.

@mr.encoder ya buddy