Convert String into Palindrome

This is a companion discussion topic for the original entry at

Can anyone please help me find the problem with this code? I am getting right answer for the first test case but wrong for the 2nd Screenshot_20200803-133534_Pydroid 3|243x500

You have to use dynamic programming for solving this problem