Problem 2381 · Medium

Shifting Letters II

Record each range shift at its two endpoints in a difference array, then move every letter by the running net shift.

Open the interactive visualisation