Problem 3361 · Medium

Shift Distance Between Two Strings

Each letter of s can move one step forward or one step backward around the alphabet, with a cost that depends on the letter it leaves.

Open the interactive visualisation