Bruteforce and Rolling Hash Algorithm to Compute the Longest Happy Prefix String (Equal Prefix and Suffix)
A string is called a happy prefix if is a non-empty prefix which is also a suffix (excluding itself). Given a string s. Return the longest happy prefix of …