Here is one implementation, but whether it is the one you are behind is completely impossible to say, because you did not indicate that, in your opinion, the answer should be:
let answer = zip(array1, array2).map {$0.0 == $0.1}
This gives you a list of Bool values, true if the answer matches the correct answer, false if it is not.
But tell me what you wanted, this is a list of indexes of those answers that are correct. Then you could say:
let answer = zip(array1, array2).enumerated().filter() { $1.0 == $1.1 }.map{$0.0}
If you want the index list of these answers to be incorrect, just change == to != .
source share