DEV Community

Discussion on: Interview Prep #1: Does String has Unique Characters

Collapse
 
godcrampy profile image
Sahil Bondre

Yea, hash maps would work as well. It's just that sets are more suitable as we don't have to store a key-value pair.
Fun fact: Sets are implemented with hash maps! unordered_set in C++11 uses hash maps behind the scenes.