K ordered lcs - getting TLE

code :-

@agarwalbhavya06 take size of dp as [2005][2005][6], this will make your code run fine.

thanks @mayankA47 it is now running fine…

Great!, mark doubt as resolved if satisfied.