text of lowercase English letters. It is cut in one place into two non-empty parts, a left one and a right one. A cut is good if the left part contains as many distinct letters as the right part.
Count the good cuts.text='banana' → 1
Of the five cuts only "ba" | "nana" works: two distinct letters on each side. For instance, "ban" | "ana" has three distinct letters on the left and two on the right.
text='qq' → 1
The only cut gives "q" | "q", one distinct letter on each side.
text='xyzx' → 1
text) ≤ 10⁵text consists only of lowercase English letterstext='banana'
1
Run checks the first 3 tests in your browser. Submit checks all 83 tests on the server, hidden ones included.