Can't pass any test cases

#include
using namespace std;
void subsequence(char arr[],char out[],int i,int j)
{
// base case
if(arr[i]==’\0’)
{
out[j] = β€˜\0’;
cout<<out<<" ";
return;
}
out[j] = arr[i];
subsequence(arr,out,i+1,j+1);

subsequence(arr,out,i+1,j);

}

int main()
{
char arr[1000];
cin>>arr;
int k = 0;
while(arr[k]!=’\0’)
{

	++k;
}
char out[1000];
subsequence(arr,out,0,0);
cout<<endl;
cout <<(1<<k);
return 0;

}

Hello @sroy3166,

I have corrected your code:


Please, refer to comment for your mistake.

Hope, this would help.
Give a like if you are satisfied.

it run on coding block ide…and the output is correct but can’t submit…can’t pass any test cases

Hello @sroy3166,

Please check it again.

It passed all the test cases for me.