FunctionRacerProblemsRace

Find All Duplicates

EasyHash mapsPython, JavaScript, TypeScript, Java, C++

Every number in nums appears either once or twice. Return the numbers that appear twice, sorted in increasing order.

Example 1

nums [4,3,2,7,8,2,3,1]
returns [2,3]

2 and 3 appear twice.

Example 2

nums [1,2]
returns []

No repeats.

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More Hash maps problems