Str with Longest Len
A prefix of a string S is any leading contiguous part of S. For example, the string "codility" has the following prefixes: "", "c", "co", "cod", "codi", "codil", "codili", "codilit", and "codility". A prefix of S is called proper if it is shorter 📏 than S.
A suffix of a string S is any trailing contiguous part of S. For example, the string "codility" has the following sufixes: "", "y", "ty", "ity", "lity", "ility", "dility", "odility" and "codility". A suffix of S is called proper if it is shorter than S.
Let's now write a func called strWithLongestLen(String S) in the editor 👉
Task of your func:
: 𓏲🐋 ๋࣭ ࣪endless thanks, spike!˖✩࿐࿔ 🌊
1Example 1
2Example 2
Constraints
Limits and guarantees your solution can rely on.
1 <= S.length() <= 1,000,000String S consists only lower case english letters (a - z)