Faulty order of elements in Printing LCS

The order of elements in the LCS is not being fetched correctly, why?

I figured the reason and fixed it, it’s still not working

updated code : https://ide.codingblocks.com/s/482746

hello @anshufirefox

the logic is incorrect , u cant get required string like this.
becuase in dp we try all possible states so becuase of that u will include some character that will not be part of required answer.

yeah, I understand it now that you’ve pointed it out

Allow me some time to come up with some other logic

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.