Search
⌘K

Leetcode 2452. Words Within Two Edits of Dictionary

Given equal-length lowercase words, return all queries that can be turned into some dictionary word with at most two letter substitutions — equivalently, whose Hamming distance to at least one dictionary word is ≤ 2. Check each query against dictionary words and count mismatches (early exit when >2) to decide inclusion.


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.