When to use Sets and when to use map? Please explain
I want to know the difference b/w Set and Map?
You need sets when basically you just want to store single property of your data . Maps are just an extension of sets where you can add various other properties as well along with your key data. Maps are generally used in place of unordered_maps(HASH_TABLES) to improve the cases where collision might occur in hashtables.
For More info read this :
https://www.geeksforgeeks.org/set-vs-map-c-stl/#:~:text=Differences%3A,value%20needed%20for%20a%20key.