Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 2223. Sum of Scores of Built Strings
Given a string s, compute the sum of lengths of the longest common prefixes between s and every suffix s[i:], i.e., sum LCP(s, s[i:]) for all i. This is a linear-time string-matching problem (commonly solved with the Z-function) to handle n up to 1e5.
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.