Problem 2825 · Medium

Make String a Subsequence Using Cyclic Increments

Walk str1 once with a pointer into str2, accepting each letter either as is or advanced one step cyclically.

Open the interactive visualisation