โ† Sabre questions

Convert S1 to palindrome containing S2 in minimum steps

Filed under Sabre

The question

Given two strings S1 and S2, convert S1 into a palindrome by replacing characters with any other character such that S1 contains S2 as a substring, using the minimum number of replacements. Return -1 if not possible.

No write-up yet. Related questions below have one.

Related Sabre questions

Collected from public candidate posts and coding forums. Updated Nov 2026.