Problem 4019 · Medium

Merge Close Characters II

Find the leftmost equal pair that sits within k positions, drop its right letter, and repeat on the shorter string until no close pair is left.

Open the interactive visualisation