getting run error for one test case
Https://ide.codingblocks.com/s/193725 LCS problem in dynamic programming
Hi @Faizan-Ali-1395131367301898
You declared dp with wrong sizes. Swap row value of dp with a.length() + 1 and column value with b.length( ) +1 .This will correct the runtime error.
Hope it Helps.
Test case 1 showing wrong answer
In return statement also, return dp[a.length()][b.length()] , You will get correct answer. If our query is resolved, mark this doubt as resolved.
Hope it Helps.
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.