Count palindrome substring

ques — https://hack.codingblocks.com/contests/c/509/236
ans — https://ide.codingblocks.com/#/s/26078

not getting the correct answer

https://ide.codingblocks.com/#/s/27426

I have made the changes and commented them along with explanations