Smart Matching

Solve a hard-level problem of matching one-character-away words in a list of strings using tries.

Problem statement

Given a list of different words and an array of string queries, return a boolean array answer where answer[i] is true if you can change exactly one character in the ithi^{th} query string to match any word in the list; return false otherwise.

Example

Sample input

Get hands-on with 1200+ tech skills courses.