In C++, create a method called findRun that finds the earliest occurrence in an array
of one or more consecutive strings that are equal to a target string
Question
bool findRun(const string a[], int n, string target, int& begin, int& end);
Find the earliest occurrence in a
of one or more consecutive strings that are equal to target
; set begin
to the position of the first occurrence of target
, set end
to the last occurrence of target
in that earliest consecutive sequence, and return true. If n
is…