Split String with Same Distinct Counts
You are given a lowercase alphabet string s
. Return the number of ways to split the string into two strings such that the number of distinct characters in each string is the same.
Constraints
1 ≤ n ≤ 100,000
wheren
is the length ofs
https://binarysearch.com/problems/Split-String-with-Same-Distinct-Counts
Examples
Example 1
Input
- s =
abaab
Output
- answer =
2
Explanation
We can split it by "ab" + "aab"
and "aba" + "ab"
Leave a comment