Practice: Selected string techniques
0 of 4 solved
About these problems
Apply, Connect, Reason and Stretch describe difficulty within this topic, not an official contest rating. Open any problem in any order; reading the chapter first is optional.
- 1Prefix border lengthsFor every prefix s[1..i] of a lowercase string, print the length of its longest proper prefix that is also a suffix. A proper prefix is shorter than the whole current prefix.ApplyNot started
- 2All pattern startsFind all starting positions where pattern p occurs in text t. Include overlapping matches. Positions are 1-based.ConnectNot started
- 3Shortest repeating blockFind the minimum positive length k such that the string is an integer number of copies of its first k characters. One copy of the whole string is allowed.ReasonNot started
- 4Every full-string borderPrint all lengths k with 1<=k<|s| such that the first k characters equal the last k characters. Output lengths increasingly; the empty border and whole string are excluded.StretchNot started