Language: C++

#include <iostream>

#include <string>
#include <unordered_map>

int TwoColorsCardGame(void) {
	std::unordered_map<std::string, int> mymap;
	std::unordered_map<std::string, int>::iterator it;
	int N, M;
	std::cin >> N;
	for (int i = 0; i < N; i++) {
		std::string temp;
		std::cin >> temp;
		if ((it = mymap.find(temp)) != mymap.end()) {
			mymap[temp] = it->second + 1;
		} else {
			mymap[temp] = 1;
		}
	}
	std::cin >> M;
	for (int i = 0; i < M; i++) {
		std::string temp;
		std::cin >> temp;
		if ((it = mymap.find(temp)) != mymap.end()) {
			mymap[temp] = it->second - 1;
		} else {
			mymap[temp] = -1;
		}
	}
	int max = 0;
	for (auto it = mymap.begin(); it != mymap.end(); ++it) {
		if (it->second > max) {
			mymap = it->second;
		}
	}
	std::cout << max;
	return 0;
}

Compiler output:
a.cc: In function 'int TwoColorsCardGame()':
a.cc:33:37: error: no match for 'operator=' (operand types are 'std::unordered_map<std::__cxx11::basic_string<char>, int>' and 'int')
   33 |                         mymap = it->second;
      |                                     ^~~~~~
In file included from /usr/include/c++/14/unordered_map:41,
                 from a.cc:4:
/usr/include/c++/14/bits/unordered_map.h:279:7: note: candidate: 'std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator=(const std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>&) [with _Key = std::__cxx11::basic_string<char>; _Tp = int; _Hash = std::hash<std::__cxx11::basic_string<char> >; _Pred = std::equal_to<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, int> >]'
  279 |       operator=(const unordered_map&) = default;
      |       ^~~~~~~~
/usr/include/c++/14/bits/unordered_map.h:279:17: note:   no known conversion for argument 1 from 'int' to 'const std::unordered_map<std::__cxx11::basic_string<char>, int>&'
  279 |       operator=(const unordered_map&) = default;
      |                 ^~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/unordered_map.h:283:7: note: candidate: 'std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator=(std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>&&) [with _Key = std::__cxx11::basic_string<char>; _Tp = int; _Hash = std::hash<std::__cxx11::basic_string<char> >; _Pred = std::equal_to<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, int> >]'
  283 |       operator=(unordered_map&&) = default;
      |       ^~~~~~~~
/usr/include/c++/14/bits/unordered_map.h:283:17: note:   no known conversion for argument 1 from 'int' to 'std::unordered_map<std::__cxx11::basic_string<char>, int>&&'
  283 |       operator=(unordered_map&&) = default;
      |                 ^~~~~~~~~~~~~~~
/usr/include/c++/14/bits/unordered_map.h:297:7: note: candidate: 'std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator=(std::initializer_list<typename std::_Hashtable<_Key, std::pair<const _Key, _Val>, _Alloc, std::__detail::_Select1st, _Pred, _Hash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<std::__not_<std::__and_<std::__is_fast_hash<_Hash>, std::__is_nothrow_invocable<const _Hash&, const _Key&> > >::value, false, true> >::value_type>) [with _Key = std::__cxx11::basic_string<char>; _Tp = int; _Hash = std::hash<std::__cxx11::basic_string<char> >; _Pred = std::equal_to<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, int> >; typename std::_Hashtable<_Key, std::pair<const _Key, _Val>, _Alloc, std::__detail::_Select1st, _Pred, _Hash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<std::__not_<std::__and_<std::__is_fast_hash<_Hash>, std::__is_nothrow_invocable<const _Hash&, const _Key&> > >::value, false, true> >::value_type = std::pair<const std::__cxx11::basic_string<char>, int>]'
  297 |       operator=(initializer_list<value_type> __l)
      |       ^~~~~~~~
/usr/include/c++/14/bits/unordered_map.h:297:46: note:   no known conversion for argument 1 from 'int' to 'std::initializer_list<std::pair<const std::__cxx11::basic_string<char>, int> >'
  297 |       operator=(initializer_list<value_type> __l)
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~