Generate subsequesnce problem


what is wrong in this code, kindly comment out the errors

Hello @mkidwai74 you have to use return in your base case to remove this error.

but your code is incomplete for the question. i mean where is your logic for the question in the code when you have to form the subsequences?


I forgot to write one statement which completes my logic and made the chnages in the base case as well,
It still gives me the wrong answer

Hello @mkidwai74 check this:


you were mixing on the character array and string operations.
if you have any doubt you can ask here:
Happy Learning!!

Can you please explain why you used a vector over here, I always get confused as to when to use a vector or not.
Also if we havea string input and string output. what are you doing in the part of the code where you push back elements.
In this partimage
Also what is happening here
image

@mkidwai74 vector is just like the array only in wich i am storing the results.
if you will directly print your op there then the order of the sequence will be exactly opposite so in order to reverse this i have first stored them in vector and then i am reversing the vector to print the result like the output format.
and that loop is called the for each loop in that auto kewors takes itself the data type according to the data structure.
and then by this syntax we can iterate through every element in the vector then just simply printing it out.
if you have any other doubt you can ask here:
Happy Learning!!

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.