Search
⌘K

Leetcode 3474. Lexicographically Smallest Generated String

Build the lexicographically smallest string of length n+m-1 such that for each i, the length-m window at i equals str2 if str1[i]=='T' and differs from str2 if str1[i]=='F'; the core challenge is satisfying overlapping equality constraints (propagating fixed characters) while ensuring every 'F' window has at least one mismatch, or reporting impossibility.


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.