
Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
For each prefix of the string, check which characters are of even frequency and which are not and represent it by a bitmask.
Find the other prefixes whose masks differs from the current prefix mask by at most one bit.