Language: C++

#include <iostream>
#include <string>
#define inf 1000000000

using namespace std;

string s;
int N;
int hash[200005];
int table[1<<26];
int dp[200005];

int main(void)
{
	cin >> s;
	N = s.size(); 
	s = " " + s;
	
	for(int i = 1; i <= N; i++){
		hash[i] = hash[i-1] ^ (1 << (s[i]-'a'));
	}
	for(int i = 1; i <= N; i++) dp[i] = inf;
	for(int i = 1; i < (1<<26); i++) table[i] = inf;
	
	for(int i = 1; i <= N; i++){
		for(int j = 0; j < 26; j++){
			dp[i] = min(dp[i], table[hash[i] ^ (1<<j)] + 1);
		}
		dp[i] = min(dp[i], table[hash[i]] + 1);
		table[hash[i]] = min(table[hash[i]], dp[i]);
	}
	
	cout << dp[N] << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:17: error: reference to 'hash' is ambiguous
   20 |                 hash[i] = hash[i-1] ^ (1 << (s[i]-'a'));
      |                 ^~~~
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/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 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:9:5: note:                 'int hash [200005]'
    9 | int hash[200005];
      |     ^~~~
a.cc:20:27: error: reference to 'hash' is ambiguous
   20 |                 hash[i] = hash[i-1] ^ (1 << (s[i]-'a'));
      |                           ^~~~
/usr/include/c++/14/bits/functional_hash.h:59:12: note: candidates are: 'template<class _Tp> struct std::hash'
   59 |     struct hash;
      |            ^~~~
a.cc:9:5: note:                 'int hash [200005]'
    9 | int hash[200005];
      |     ^~~~
a.cc:27:50: error: reference to 'hash' is ambiguous
   27 |                         dp[i] = min(dp[i], table[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:9:5: note:                 'int hash [200005]'
    9 | int hash[200005];
      |     ^~~~
a.cc:29:42: error: reference to 'hash' is ambiguous
   29 |                 dp[i] = min(dp[i], table[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:9:5: note:                 'int hash [200005]'
    9 | int hash[200005];
      |     ^~~~
a.cc:30:23: error: reference to 'hash' is ambiguous
   30 |                 table[hash[i]] = min(table[hash[i]], dp[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:9:5: note:                 'int hash [200005]'
    9 | int hash[200005];
      |     ^~~~
a.cc:30:44: error: reference to 'hash' is ambiguous
   30 |                 table[hash[i]] = min(table[hash[i]], dp[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:9:5: note:                 'int hash [200005]'
    9 | int hash[200005];
      |     ^~~~