It will work perfectly if there are no duplicate values, for the duplicates the function logic needs tweaking a lot. I will take a look if I get some spare time or feel free to have a think about it.
About the game design, how do you know the second L is the one missing from the second array if they're identical values, is it always checking in the order of array 1 ? Technically L does exist but you want to output 3.