0828. Count Unique Characters of All Substrings of a Given String
Description
**Input:** s = "ABC"
**Output:** 10
**Explanation:** All possible substrings are: "A","B","C","AB","BC" and "ABC".
Evey substring is composed with only unique letters.
Sum of lengths of all substring is 1 + 1 + 1 + 2 + 2 + 3 = 10**Input:** s = "ABA"
**Output:** 8
**Explanation:** The same as example 1, except countUniqueChars("ABA") = 1.**Input:** s = "LEETCODE"
**Output:** 92ac
Last updated