Please review for the suggestion

is the code alright or is this not the correct approach to solve the problem, i was thinking to solve this using string tokenizer but was’nt able to solve it. please suggest

link to the code is

@pranav_sharma
Longest Common Subsequence or simply LCS is a very famous DP problem. This problem has been covered in your course with code and detailed explanation in Dynammic Programming section of your course. Kindly refer to it. While your code will produce the correct results , it is not optimised as we would end up making recursive calls to same instances several time hence increasing the time complexity of the code. Hence we should use DP to optimise this.

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.