Spelling Correction-Based Search

Solve a medium-level problem of querying one-character-away strings from search engines using tries.

Problem statement

Design and implement a search system that returns one-character-away suggestions. Strings that differ in only one letter are one-character-away strings. For example, kit and kat differ only in the second position. Below is a list of unique words present in the datastore and an array of string queries. Return one character away from strings present in the datastore for all the string queries.

Example

Sample input

Get hands-on with 1200+ tech skills courses.