SpaceX Interview Question

You are given code to compare unsorted list of Strings from one array to unsorted Strings inside of another array. If there are matches, then print out. The given code is two for-loops with the print statement inside to print matches. You are instructed to optimize.