Run error is coming in some test case

#include
using namespace std;

bool isSum(int a[],int n,int s){
int dp[n+1][s+1];
for (int i=0;i<=n;i++){
for(int j=0;j<=s;j++){
if(i==0){
dp[0][j]=false;
}
if(j==0){
dp[i][0]=true;
}

		else if(a[i-1]<=j){
			dp[i][j]=dp[i-1][j-a[i-1]] || dp[i-1][j];
		}
		else{
			dp[i][j]=dp[i-1][j];
		}
	}
}
return dp[n][s];

}
int main() {
int n,s;
cin>>n>>s;
int a[n];
for(int i=0;i<n;i++){
cin>>a[i];
}
if(isSum(a,n,s)){
cout<<“Yes”;
}
else{
cout<<“No”;
}
return 0;
}

hello @mansi25

pls save ur code here->https://ide.codingblocks.com/
and share its link with me

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.