Search
⌘K

Leetcode 2301. Match Substring After Replacement

Determine whether you can make sub equal to some contiguous substring of s by applying at most one single-step replacement (old -> new) to each character of sub from the given mappings. Equivalently, for each position compute the set of allowable characters (the original character plus any direct mappings) and check whether any length-|sub| window in s matches those per-position allowances.


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.