




Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Each s_i is a suffix of the string s, so consider algorithms that can determine the longest prefix that is also a suffix.
Could you use the Z array from the Z algorithm to find the score of each s_i?