How many times word appears in two arrays?

Feb 12 2019 1:54 PM
Hello all,
 
I have two string arrays as follows:
 
string array1[] = { "once", "in", "a", "lifetime", "chance", "success" };
string array2[] = { "success", "is", "the", "only", "option" };
 
I want to have a function that will take the two arrays and return the number of times a word appears in both arrays.   I also want to have a function that takes in both arrays and returns the max number of characters for any word in both arrays.
 
Thanks for any help 

Answers (4)