algorithms – Find non common numbers in two arrays

Given two arrays of integers, please write a function that returns all elements present in one of the two arrays but not both. E.g. f(( 1, 3, 5 ), ( 1, 2, 4, 5 )) -> ( 2, 3, 4 )

I know I can do this with two for loops that is O(n^2) but is there any better way ? Please help