Spoj: LCS2

problem : LCS2
Can someone please help me in optimizing my solution (giving TLE). I am trying this for the last 4 days.
Any other method for solving this using Suffix Trees will also be helpful.

1 Like