Today I was solving this problem: https://www.codechef.com/ICPCIN19/problems/TRAINSET
and I thought of doing it using maps with string as key and value in the map as pair ( pair consists of the number of occurrences of the string with bool 0 and bool 1)
And every time I encounter a string , if it is already in the map then I want to increase the number in the pair by 1 if it is not there I will insert the key and value pair in the map
I implemented this and here is my code :
It will be good if someone tells me how to access the first and the second element of pairs in map
Thanks a lot!