Available question text
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.
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 2223. Sum of Scores of Built Strings
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source