Tap here to switch tabs
Problem
Submissions

Problem: Words Within Two Edits of Dictionary

med
30 min
Try to solve the Words Within Two Edits of Dictionary problem.

Statement

You are given two string arrays, queries and dictionary, where all strings in both arrays have the same length.

In one edit, you can choose any character of a word and replace it with any other lowercase English letter.

Return a list of all strings in queries that can be transformed to match at least one word in dictionary using at most 22 edits. The output list should preserve the original relative order of the words in queries.

Constraints:

  • 1≤1 \leq queries.length, dictionary.length ≤100\leq 100

  • n ==== queries[i].length ==== dictionary[j].length

  • 1≤1 \leq n ≤100\leq 100

  • All queries[i] and dictionary[j] consist of lowercase English letters.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Words Within Two Edits of Dictionary

med
30 min
Try to solve the Words Within Two Edits of Dictionary problem.

Statement

You are given two string arrays, queries and dictionary, where all strings in both arrays have the same length.

In one edit, you can choose any character of a word and replace it with any other lowercase English letter.

Return a list of all strings in queries that can be transformed to match at least one word in dictionary using at most 22 edits. The output list should preserve the original relative order of the words in queries.

Constraints:

  • 1≤1 \leq queries.length, dictionary.length ≤100\leq 100

  • n ==== queries[i].length ==== dictionary[j].length

  • 1≤1 \leq n ≤100\leq 100

  • All queries[i] and dictionary[j] consist of lowercase English letters.