Problem 2486 · Medium

Append Characters to String to Make Subsequence

Match t greedily inside s with one pointer; whatever part of t is left unmatched must be appended.

Open the interactive visualisation