# Help me in solving CS2023_PON problem

### My issue

cannot able to find why it is getting wrong answer tle is fine but why wrong answer can anyone explain?

### My code

``````#include <iostream>
using namespace std;
bool check(int arr[],int ind,int b,int req){
//base case
// if(ind==0){
//     // if(b==req) return true;
//     // if(b&arr[0]==req) return true;
//     // else
//     // return false;
//     if(ind<0){

//     }
// }
if(ind<0){
if(b==req) return true;
return false;
}

//recursive call
bool notTake=check(arr,ind-1,b,req);
bool take=check(arr,ind-1,b&arr[ind],req);
return notTake||take;
}

int main() {
int t;
cin>>t;
while(t--){
int n,b;
cin>>n>>b;
int arr[n];
for(int i=0;i<n;i++) cin>>arr[i];
int ind=n-1,req=b;
bool find= check(arr,ind,b,req);
if(find==true) cout<<"yes"<<endl;
else cout<<"No"<<endl;
}
return 0;
}

``````

Problem Link: CS2023_PON Problem - CodeChef

@anuragtmh12
i guess the logic is not right
i give u one hint u can only make b with the numbers having a[i]&b==b
this will eliminate the garbage values then after doing one more stuff among those filtered numbers u will get the answer.