Given two arrays of strings (or a string and a pattern string), find all anagrams of the target(s) within the source and return their first indices. In the array variant: the second array is the set of targets; for each target string, find all strings in the first array that…