Skip to main content
2 of 8
deleted 9 characters in body
Jitse
  • 8.1k
  • 3
  • 21
  • 45

Python 3, 68 bytes

f=lambda s,i=1:i*(s[:i-1]==s[:i-len(s)%2:-1])or i-len(s)and f(s,i+1) 

Try it online!

Returns the 1-indexed character if the operation can be done and 0 otherwise.

Jitse
  • 8.1k
  • 3
  • 21
  • 45