Language: C++

#include <bits/stdc++.h>
using namespace std;
int hash[200005],ans[200005],memo[1<<26],arr[26];

int main(){
	for(int i=0;i<(1<<26);i++) memo[i]=INT_MAX;
	string s;
	cin >> s;
	int len=s.length();
	s="*"+s;
	hash[0]=0;
	for(int i=1;i<=len;i++){
		arr[s[i]-'a']++;
		int hv=0;
		for(int j=0;j<26;j++){
			if(arr[j]%2) hv=(hv|(1<<j));
		}
		hash[i]=hv;
	}
	memo[0]=0;
	for(int i=1;i<=len;i++){
		ans[i]=i;
		if(memo[hash[i]]!=INT_MAX) ans[i]=min(ans[i],memo[hash[i]]+1);
		for(int j=0;j<26;j++){
			if(memo[hash[i]^(1<<j)]!=INT_MAX) ans[i]=min(ans[i],memo[hash[i]^(1<<j)]+1);
		}
		memo[hash[i]]=min(memo[hash[i]],ans[i]);
	}

	cout << ans[len] << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: reference to 'hash' is ambiguous
   11 |         hash[0]=0;
      |         ^~~~
In file included from /usr/include/c++/14/string_view:50,
                 from /usr/include/c++/14/bits/basic_string.h:47,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/functional_hash.h:59:12: note: candidates are: 'template<class _Tp> struct std::hash'
   59 |     struct hash;
      |            ^~~~
a.cc:3:5: note:                 'int hash [200005]'
    3 | int hash[200005],ans[200005],memo[1<<26],arr[26];
      |     ^~~~
a.cc:18:17: error: reference to 'hash' is ambiguous
   18 |                 hash[i]=hv;
      |                 ^~~~
/usr/include/c++/14/bits/functional_hash.h:59:12: note: candidates are: 'template<class _Tp> struct std::hash'
   59 |     struct hash;
      |            ^~~~
a.cc:3:5: note:                 'int hash [200005]'
    3 | int hash[200005],ans[200005],memo[1<<26],arr[26];
      |     ^~~~
a.cc:23:25: error: reference to 'hash' is ambiguous
   23 |                 if(memo[hash[i]]!=INT_MAX) ans[i]=min(ans[i],memo[hash[i]]+1);
      |                         ^~~~
/usr/include/c++/14/bits/functional_hash.h:59:12: note: candidates are: 'template<class _Tp> struct std::hash'
   59 |     struct hash;
      |            ^~~~
a.cc:3:5: note:                 'int hash [200005]'
    3 | int hash[200005],ans[200005],memo[1<<26],arr[26];
      |     ^~~~
a.cc:23:67: error: reference to 'hash' is ambiguous
   23 |                 if(memo[hash[i]]!=INT_MAX) ans[i]=min(ans[i],memo[hash[i]]+1);
      |                                                                   ^~~~
/usr/include/c++/14/bits/functional_hash.h:59:12: note: candidates are: 'template<class _Tp> struct std::hash'
   59 |     struct hash;
      |            ^~~~
a.cc:3:5: note:                 'int hash [200005]'
    3 | int hash[200005],ans[200005],memo[1<<26],arr[26];
      |     ^~~~
a.cc:25:33: error: reference to 'hash' is ambiguous
   25 |                         if(memo[hash[i]^(1<<j)]!=INT_MAX) ans[i]=min(ans[i],memo[hash[i]^(1<<j)]+1);
      |                                 ^~~~
/usr/include/c++/14/bits/functional_hash.h:59:12: note: candidates are: 'template<class _Tp> struct std::hash'
   59 |     struct hash;
      |            ^~~~
a.cc:3:5: note:                 'int hash [200005]'
    3 | int hash[200005],ans[200005],memo[1<<26],arr[26];
      |     ^~~~
a.cc:25:82: error: reference to 'hash' is ambiguous
   25 |                         if(memo[hash[i]^(1<<j)]!=INT_MAX) ans[i]=min(ans[i],memo[hash[i]^(1<<j)]+1);
      |                                                                                  ^~~~
/usr/include/c++/14/bits/functional_hash.h:59:12: note: candidates are: 'template<class _Tp> struct std::hash'
   59 |     struct hash;
      |            ^~~~
a.cc:3:5: note:                 'int hash [200005]'
    3 | int hash[200005],ans[200005],memo[1<<26],arr[26];
      |     ^~~~
a.cc:27:22: error: reference to 'hash' is ambiguous
   27 |                 memo[hash[i]]=min(memo[hash[i]],ans[i]);
      |                      ^~~~
/usr/include/c++/14/bits/functional_hash.h:59:12: note: candidates are: 'template<class _Tp> struct std::hash'
   59 |     struct hash;
      |            ^~~~
a.cc:3:5: note:                 'int hash [200005]'
    3 | int hash[200005],ans[200005],memo[1<<26],arr[26];
      |     ^~~~
a.cc:27:40: error: reference to 'hash' is ambiguous
   27 |                 memo[hash[i]]=min(memo[hash[i]],ans[i]);
      |                                        ^~~~
/usr/include/c++/14/bits/functional_hash.h:59:12: note: candidates are: 'template<class _Tp> struct std::hash'
   59 |     struct hash;
      |            ^~~~
a.cc:3:5: note:                 'int hash [200005]'
    3 | int hash[200005],ans[200005],memo[1<<26],arr[26];
      |     ^~~~