std::set

Simple insert

 

Quick match

 

Store search result

 

Check if duplicate insert