Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 2955. Number of Same-End Substrings
Count the number of substrings in a given string whose first and last character are the same. This reduces to aggregating contributions per character (single-character substrings plus pairs of equal endpoints) so you can compute the answer in linear time using frequency counts.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.