Longest Prefix Suffix
medium
Given a string S, print the longest Prefix which is also a suffix. Try doing it using constant space.
Constraints
2 <= |S| <= 10^5
Format
Input
A string S
Output
Print the answer, print "" (without quotes) if no answer found.
Example
Sample Input
abcab
Sample Output
ab