Chant Rhythm
Challenge on lesson: Contest 3-B: Chant Rhythm
CHALLENGE
Difficulty: advanced+25 XP
**Problem.** Given a chant string s, print the length of its shortest period p — the smallest p such that s[i] == s[i-p] for every i >= p. **Constraints:** 1 <= |s| <= 2000001. The period need not divide |s|. **R versus W.** The graded wrong solution only checks lengths that divide |s| and reports |s| otherwise.
Press Submit to check your solution.
Back to lesson: Contest 3-B: Chant Rhythm