Language: C++

#include <iostream>
#include <string>
#include <vector>
using namespace std;

int main() {
	int n;
	cin >> n;
	vector<string> s(n);
	for (int i = 0; i < n; i++) {
		cin >> s.at(i);
	}
	int m;
	cin >> m;
	vector<string> t(m);
	for (int i = 0; i < m; i++) {
		cin >> t.at(i);
	}
	vector<int> resultPoint(0);

	while (s.size() > 0) {
		string first = s.at(0);
		s.erase(s.begin());
		int count = 1;
		while (true) {
			auto it = find(s.begin(), s.end(), first);
			if (it != s.end()) {
				count++;
				s.erase(it);
			}
			else {
				break;
			}
		}
		while (true) {
			auto it = find(t.begin(), t.end(), first);
			if (it != t.end()) {
				count--;
				t.erase(it);
			}
			else {
				break;
			}
		}
		resultPoint.emplace_back(count);
	}
	while (t.size() > 0) {
		string first = t.at(0);
		t.erase(t.begin());
		int count = -1;
		while (true) {
			auto it = find(t.begin(), t.end(), first);
			if (it != t.end()) {
				count--;
				t.erase(it);
			}
			else {
				break;
			}
		}
		resultPoint.emplace_back(count);
	}
	
	int max = resultPoint.at(0);
	for (int i = 1; i < resultPoint.size();i++) {
		if (max < resultPoint.at(i)) {
			max = resultPoint.at(i);
		}
	}
	
	cout << max;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:39: error: no matching function for call to 'find(std::vector<std::__cxx11::basic_string<char> >::iterator, std::vector<std::__cxx11::basic_string<char> >::iterator, std::string&)'
   26 |                         auto it = find(s.begin(), s.end(), first);
      |                                   ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:26:39: note:   '__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >' is not derived from 'std::istreambuf_iterator<_CharT>'
   26 |                         auto it = find(s.begin(), s.end(), first);
      |                                   ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:36:39: error: no matching function for call to 'find(std::vector<std::__cxx11::basic_string<char> >::iterator, std::vector<std::__cxx11::basic_string<char> >::iterator, std::string&)'
   36 |                         auto it = find(t.begin(), t.end(), first);
      |                                   ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:36:39: note:   '__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >' is not derived from 'std::istreambuf_iterator<_CharT>'
   36 |                         auto it = find(t.begin(), t.end(), first);
      |                                   ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:52:39: error: no matching function for call to 'find(std::vector<std::__cxx11::basic_string<char> >::iterator, std::vector<std::__cxx11::basic_string<char> >::iterator, std::string&)'
   52 |                         auto it = find(t.begin(), t.end(), first);
      |                                   ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:52:39: note:   '__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >' is not derived from 'std::istreambuf_iterator<_CharT>'
   52 |                         auto it = find(t.begin(), t.end(), first);
      |                                   ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~