Why is a HashSet faster than an Array in this Duplicate Integers problem?
I am new to learning data structures and algorithms and am starting NeetCode 150 problems. The first problem I encountered was not difficult, I understand why it works, but I am curious to why the best solution involves the use of a HashSet instead of an array.