⚠ simulated AI-generated code
This code is framed as if an AI coding assistant wrote it, and has a realistic issue AI assistants actually produce — sometimes a real bug, sometimes code that runs fine but is more complicated or less idiomatic than it needs to be. It is not from a real model call. Read it like you'd review any AI suggestion — don't assume it's correct, or well-written, just because it looks polished.
An AI assistant wrote find_common_elements(a, b) to return the elements that appear in both lists, with no duplicates in the result. It works on the simple case — try it with a repeated value in both lists.
fix this code so it matches
find_common_elements([1, 2, 3], [2, 3, 4]) is [2, 3]. find_common_elements([1, 2], [3, 4]) is []. find_common_elements([2, 2, 3], [2, 2, 5]) is [2] (only once). find_common_elements([], [1, 2]) is [].