CodeOath
← All problems

Find All Duplicates

Easy
arrayshash-table

Return the values that appear more than once (each listed once; order doesn't matter).

Example:

Input: arr = [1, 2, 3, 2, 1]
Output: [1, 2]