What's wrong with my code?

I am trying this problem on longest palindromic subsequence.


Here is my code-
https://pastebin.com/sDKrqg5g
I am unable to find the bug.Kindly help.Kindly tell how to approach this problem,how to calculate the center of the longest palindromic subsequence