word of lowercase English letters. In one move you can insert any letter anywhere in the word, including the very start or end.
Return the smallest number of moves after which the word reads the same forwards and backwards.word="kayak" → 0
The word already reads the same both ways.
word="tab" → 2
Two letters are needed, for example to get "batab".
word="abca" → 1
One letter is enough: "abcba" or "acbca".
word consists of lowercase English lettersword="kayak"
0
Run checks the first 3 tests in your browser. Submit checks all 126 tests on the server, hidden ones included.