Here is the code I came up with but it got a problem

It is not giving me the lcs really
Tell me the error in it

for longest consequtive subsequence you have to apply dp approach. Please post the question also, so that I can help you with coding in this one.

It’s the hashing method

Here, how to do it using hashing:

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.