#3084
Count Substrings Starting and Ending with Given Character
medium · 49.9% accepted · 148 likes · top 37%
Description
You are given a string s and a character c. Return the total number of substrings of s that start and end with c.
Solution