Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Use the LCP array to determine which groups of elements must be equal.
Match the smallest letter to the group that contains the smallest unassigned index.
Build the LCP matrix of the resulting string then check if it is equal to the target LCP.