My issue
Shows runtime error on submit even though the code works on tests againsst custom input.
My code
#include <bits/stdc++.h>
using namespace std;
int main() {
// your code goes here
int N,X,flag=0;
cin>>N>>X;
bool found=false;
int A[100];
for(int i=0;i<N;i++){
cin>>A[i];
if (A[i]==X){
found=true;
break;
}
}
if (found){
cout<<"YES";
}
else{
cout<<"NO";
}
return 0;
}
Learning course: Data structures & Algorithms lab
Problem Link: https://www.codechef.com/learn/course/muj-aiml-dsa-c/MUJADSAC06/problems/SEARCHINARR