Longest Happy Prefix
Hard📝 Description
Find the longest prefix which is also suffix
Input Format
A string
Output Format
Longest happy prefix
Constraints
1 ≤ s.length ≤ 10^5
🔍 Sample Input
"level"
✅ Sample Output
"l"
Code Editor
Please login to run and submit code.
Results
Suggested Solution
Shortcuts: Ctrl+Enter to submit, Ctrl+Shift+R to run