So I think I finally understood logic of test creators.
Even if you write a classical DP or memorization solution for this one you will timeout on latest tests.
I think they consider it edge cases. Because if you add one simple line it will pass! OMG.
I have leet code for this. Instead of solving problems I spend hours optimizing the constants.
if s == s[::-1]: return s