Problems > First Repeated Value > Editorial

First Repeated Value — Solution & Editorial

Back to the Problem

Maintain a hash set of everything seen so far; the first membership hit is the answer.

Complexity: O(N)