Using multimap library is so much efficent in this situation.
Watch to understand it - YouTube
If you don't get it look for map function firstly.
Using multimap library is so much efficent in this situation.
Watch to understand it - YouTube
If you don't get it look for map function firstly.