Question

Given the string S = "aabaaab" for Z-Algorithm, what is the Z-array for this string? (Z is typically 0 or undefined).

A [0, 1, 0, 2, 3, 1, 0]
B [7, 1, 0, 2, 3, 1, 0]
C [0, 0, 1, 0, 2, 3, 1]
D [0, 1, 2, 0, 1, 2, 3]
E [0, 0, 0, 0, 0, 0, 0]
Practice Next

Hey! Ask a query