Print Longest Common Subsequence

This code currently returns the length of the longest common sub sequence. How can I modify this code so that it simply prints out the longest common sub sequence?

LINK : https://ide.codingblocks.com/s/356006

Hey @gptradhika1208 it’s quite tough to trace your common subsequence while doing recursion, but if you are doing it using an iterative approach, you will definitely be able to get the common subsequence. Here’s my code


For referral purposes. Try to understand it’s functioning and then implement on your own :slight_smile:

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.

Thankyou, it really helped.

hello @gptradhika1208
u have reopened the doubt. if u still have any doubt then u can ask it here

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.