Boggle-type counter, takes inputs of a target word and an array and counts the number of unique instances of the word in the array