Can you tell the problem in my code
Subsequences problem
the error is because of the line
finda(str.substr(1));
the str length may not always be of leng 1
u`ll have to apply a check

still u dont get a correct answer for it
refer to the below code
After doing the change suggested by you in my code, can you tell why is it not working ?
i could not understand your approach
if u could elaborate on it it would help me debug it better
suppose the starting string is “abc”.
a)Call abc
b)Call on bc
c)Call on c (here string size is 1, store this string in a vector of string and return that vector)
d)The call goes to b) . Then use str[0] ie ‘b’ and add that to the vector after that vector becomes <c,bc>
Then add ‘b’ to this vector so it becomes <c,bc,b> and return that. Now control goes back to a) and so on…
there`s some issue with how u are using the vector
try making them global and adding the subsequence into the global vector
and finally sorting in the end to get reverse lexo graphic order
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.