Find Duplicates in Array

00:00
EasyArrayHashSetSorting
TCSWiproCTS

Given an integer array, find all elements appearing more than once. Return duplicates in any order.

Examples

Input → [4,3,2,7,8,2,3,1]
Output → [2,3]
Input → [1,1,2]
Output → [1]
Input → [1,2,3]
Output → []