Skip to main content

Practice · 2 of 9

Mixed A2

CHALLENGE
Difficulty: advanced+25 XP

**Bài toán.** Given a string s of lowercase letters, print the length of the shortest string t such that s is a concatenation of one or more copies of t. If s is not periodic, the answer is |s| itself (one copy). **Constraints:** 1 ≤ |s| ≤ 10^6. **Input:** one line: s. **Output:** one integer — the shortest period length.

Back to lesson: Practice: Mixed Sets A/B/C — Topics Hidden