Problem 1429 · Medium

First Unique Number

Maintain a growing queue of integers and, on request, report the earliest value that has so far appeared exactly once, or -1 when every value is repeated.

Open the interactive visualisation