Only 1 testcase is not running pls check

https://ide.codingblocks.com/s/283590 Refer this and verify your dp formula
This is a 3D DP problem, so you will have to store 3 states.

this is a o(n^3) approach is thier any way to decrease its complexity??

No it cannot be optimized more.
LCS with 2 strings was O(N^2)
LCS with 3 strings is similar to that. Here you have to perform the same LCS check for all the 3 strings. So it will be O(N^3) with DP.

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.