K-Ordered LCS - Wrong output

I am getting wrong output for the given sample test case. Please go through my code.

here is your corrected code:


if this solves your doubt please mark it as resolved :slight_smile: