Search
⌘K

Leetcode 3455. Shortest Matching Substring

Given s and a pattern p containing exactly two '*' wildcards (each matching any sequence, including empty), find the length of the shortest substring of s that matches p (or -1 if none). The core challenge is to efficiently align the fixed letter segments around the two stars to minimize the substring span under s's length constraints (up to 1e5).


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.