Practice · 2 of 3
Z-Array
CHALLENGE
Difficulty: advanced+25 XP
**Problem.** Line 1: string s. Print its Z-array on one line, space-separated. **Constraints:** 1 ≤ |s| ≤ 300000. O(n) z-box construction; the naive comparison is the timeout trap.
Press Submit to check your solution.
Back to lesson: Practice: String Trio