i have the code for the following problem but it's not working plz help me out!
we have to enter first name and last names of 5 people of which two have same
first name and three share the last name and find if any of them have both
first and last names as same using map.
map is not the right container for this, at least the way you are using it. Keys must be unique. So if you make the Key the last name, then no two people with the same last name can have the same first name. And vice versa.
You want a multimap (which is a map that allows non-unique keys).