Tap here to switch tabs
Problem
Submissions

Problem: Count Unique Characters of All Substrings of a String

Try to solve the Count Unique Characters of All Substrings of a String problem.

Statement

Let countUniqueChars(t) denote the number of unique characters in a string t, which is the count of characters that appear exactly 11 time in t.

Given a string s, return the sum of countUniqueChars(t) for every substring t of s.

Notice that identical substrings appearing at different positions in s are counted separately.

Constraints:

  • 1≤1 \leq s.length ≤105\leq 10^5

  • s consists of uppercase English letters only.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Count Unique Characters of All Substrings of a String

Try to solve the Count Unique Characters of All Substrings of a String problem.

Statement

Let countUniqueChars(t) denote the number of unique characters in a string t, which is the count of characters that appear exactly 11 time in t.

Given a string s, return the sum of countUniqueChars(t) for every substring t of s.

Notice that identical substrings appearing at different positions in s are counted separately.

Constraints:

  • 1≤1 \leq s.length ≤105\leq 10^5

  • s consists of uppercase English letters only.