Back to problems

Minimum Subsequences to Form a Target String

Algorithm · Pinterest · Medium

Shortest Way to Form String Medium · Topics · Company Tags · Hints You are given two strings, source and target, both composed solely of lowercase English letters. Starting from source, you may delete any number of characters without changing the order of those that remain, thereby obtaining a subsequence of source. Your task is to concatenate the fewest possible such subsequences, in the order they are produced, so that the resulting combined string exactly matches target.…

Checking your access…