Problems > Longest Common Suffix > Editorial

Longest Common Suffix — Solution & Editorial

Back to the Problem

Mirror of common-prefix: shrink a candidate suffix against each word (or reverse everything and reuse the prefix method).

Complexity: O(total length)