Groups
Category
Think Backwards is a problemโsolving pattern where you reverse time or direction so hard deletions become easy insertions and the final state becomes the starting point.
The Z-function of a string S computes for each position i the length of the longest substring starting at i that matches the prefix of S.