Skip to main content
1 of 2
Martin Ender
  • 198.2k
  • 67
  • 455
  • 999

Wolfram Language (Mathematica), 53 bytes

#/.{a___,Shortest@b___,c___}/;PalindromeQ[a<>c]:>{b}& 

Try it online!

Input and output are lists of characters. The test suite does the conversion from and to actual strings for convenience.

Martin Ender
  • 198.2k
  • 67
  • 455
  • 999