A string-matching algorithm wants to find the starting index index in string haystack that matches…
index
haystack