I can't quite understand how does this code work as i do not really understand how to use the map and vector containers. Can anyone please help? Thank You.
A map container holds a list of pairs that have keys paired with items. The keys are used to sort and uniquely identify the items.
Vector containers are a more advanced type of array that can resize itself automatically.
Edit: I almost forgot about linking the pair reference page. http://www.cplusplus.com/reference/utility/pair/
Pair containers have two data elements called first and second. Map containers hold a list of these pair containers.