A suffix array lists the starting positions of a string's suffixes in sorted order. Together with the LCP array (the longest common prefix of each adjacent pair), it answers many string questions quickly.
Unlock this and every premium problem across all tracks — plus hidden-test grading, advanced AI engineering modules and new content every week.
Start 7-day free trial