First Repeated Value — Solution & Editorial
Maintain a hash set of everything seen so far; the first membership hit is the answer.
Complexity: O(N)
Maintain a hash set of everything seen so far; the first membership hit is the answer.
Complexity: O(N)