Leetcode 1392. Longest Happy Prefix
Given a string s (|s| ≤ 10^5), return the longest non-empty proper prefix that is also a suffix (i.e., the longest "border") of s. This is typically solved by computing the KMP prefix-function (LPS) or using Z-function/rolling hashes to find the maximum matching border efficiently.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
0
Hello Interview Premium
Your account is free and you can post anonymously if you choose.