Search
⌘K

Leetcode 3302. Find the Lexicographically Smallest Valid Sequence

Find an increasing sequence of indices in word1 of length |word2| such that the characters at those indices form a string that differs from word2 in at most one position, and return the lexicographically smallest such index array (or empty if none exists). This is a subsequence-selection problem with a one-mismatch constraint, requiring feasibility checks to choose the earliest valid indices.


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.