HashTable
int partitionString(char* s) {
int start = 0;
int len = strlen(s);
int max_len = 0;
int count = 1;
int hashtab[256];
memset(hashtab, -1, sizeof(hashtab));
for (int i = 0; i < len; i++) {
if (hashtab[s[i]] >= start) {
start = i;
count++;
}
hashtab[s[i]] = i;
}
return count;
}Bitmask as HashTable
int partitionString(char* s)
{
int i,n,cnt,found;
n=(int)strlen(s);
cnt=1;
found=0;
for(i=0;i<n;i++)
{
if(found&(1<<(s[i]-'a')))
{
found=0;
cnt++;
}
found|=1<<(s[i]-'a');
}
return cnt;
}