Given a string s, return the total number of substrings of s that begin and end with the same character.
A substring is a contiguous non empty sequence of characters within a string.
Constraints:
s.length
s consists only of lowercase English letters.
Given a string s, return the total number of substrings of s that begin and end with the same character.
A substring is a contiguous non empty sequence of characters within a string.
Constraints:
s.length
s consists only of lowercase English letters.