Smallest Repeating Period
Find the smallest k such that the whole string is the first k characters repeated n/k times. If there is no such proper repetition the answer is the length of the string.
Constraints
1 <= |s| <= 10^5
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.