You have a large list of phrases P[]. i.e -> ["i would have", "they love", i analyzed", "made
decision", ...]
You will be given Queries[query_string]. i.e -> ["since this morning i have analyzed all the data
from the company and made my decision”, “they love the idea"]
Your task is to fuzzy search all the phrases in the query string. For the above example, the
resultant search phrases are -> [["i have analyzed", "made my decision"], ["they love"]]
Note: A fuzzy search is that there can be at max extra one word in the phrase.
The query_strings will come one by one online.
Constraints ->
● 1 < length(P) < 1000000
● 1 < length(query_string) < 100000
● 1 < length(Queries) < 1000
Example ->
Given ->
P = ["i would have", "they love", i analyzed", "made decision"]
Queries = [
"since this morning i have analyzed all the data from the company and made my decision",
"they love the idea",
]
Expected Output = [
[“i have analyzed”, “made my decision”],
[“they love”]
]