Question DSA-HASH-0007
EasyWhich problem is a classic use of a hash set?
- A.
Balancing a tree
- B.
Checking whether an array contains duplicates in O(n)
- C.
Show answer and explanation
Answer: B
Add each element to a set; if it is already there, you have found a duplicate.