I believe CodeSignal AI is correct in identifying an issue with your solution. Consider this test case: ["apple", "banana", "banana"]. Your code currently returns "", but the answer should be "apple".
["apple", "banana", "banana"]
""
"apple"