Longest Prefix Which Is Also a Suffix
Medium
String Matching Algorithms
Print the length of the longest proper prefix of a string that is also a suffix of it. A proper prefix is not the whole string.
Constraints
1 <= len(s) <= 10^6
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.