Available question text
Given words and a target, each valid piece is any prefix of any word; return the minimum number of such prefixes that concatenate to form target, or -1 if impossible. This is a shortest-segmentation problem based on prefix matching (solvable with DP/trie) with target length up to ~5k and total words length up to ~1e5.
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
Meta
Leetcode 3291. Minimum Number of Valid Strings to Form Target I
Reported May 29, 2025 · 2 source reports
MID_LEVEL, SENIOR
Source snapshot: Nov 12, 2026
View source