Leetcode 1055. Shortest Way to Form String
Given a source and target string, return the minimum number of subsequences of source that need to be concatenated to form target (or -1 if any target character doesn't appear in source). The core challenge is to cover the target by repeatedly taking ordered subsequences from source and minimizing the number of passes.
Asked at:
Pinterest
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
0
Early August, 2026
Pinterest
Mid-level
Late July, 2026
Pinterest
Mid-level
Early July, 2026
Pinterest
Mid-level
Original requirement: return boolean if target can be created from source, follow up: return minimum subsequences to create target from source
Hello Interview Premium
Your account is free and you can post anonymously if you choose.