Given a text string (e.g., "The quick brown fox jumps over the lazy dog") and a search query consisting of one or more words plus an integer k, determine whether all query words appear in the text such that consecutive query words are at most k words apart (in the…