1781. Sum of Beauty of All Substrings
Description
**Input:** s = "aabcb"
**Output:** 5
**Explanation:** The substrings with non-zero beauty are ["aab","aabc","aabcb","abcb","bcb"], each with beauty equal to 1.**Input:** s = "aabcbaa"
**Output:** 17ac
Last updated