# Help me in solving CS2023_PON problem

### My code

``````#include<bits/stdc++.h>
using namespace std;

void getsubsequence(int index,vector<int>&arr,vector<int>&temp,vector<vector<int>>&ans){
if(index>=arr.size()){
ans.push_back(temp);
return;
}

// Pick the Index
temp.push_back(arr[index]);

getsubsequence(index+1,arr,temp,ans);

// Not pick Index
temp.pop_back();
getsubsequence(index+1,arr,temp,ans);

}

bool isPresent(vector<vector<int>>&ans,int b){

for(int i=0;i<ans.size();i++){

int res=ans[i][0];

for(int j=i+1;j<ans[i].size();j++){
res=(res&ans[i][j]);
cout<<"Took:"<<res<<endl;
}

if(res==b){
cout<<"HI"<<endl;
return 1;
}
res=0;
}
return 0;
}

int main()
{
int t;
cin>>t;

while(t--){
int n;
cin>>n;

int b;
cin>>b;

vector<int>v;
for(int i=0;i<n;i++){
int x;
cin>>x;

v.push_back(x);
}

vector<vector<int>>ans;
vector<int>temp;

getsubsequence(0,v,temp,ans);

for(int i=0;i<ans.size();i++){
for(auto it:ans[i]){
cout<<it<<"->";
}cout<<endl;
}

int count=0;

if(isPresent(ans,b)) cout<<"YES"<<endl;
else cout<<"NO"<<endl;
cout<<"REACHED HERe"<<endl;
}
return 0;
}

``````

Problem Link: CS2023_PON Problem - CodeChef