Problem Brief
Find the Longest Isolated Substring Length
NEW GRADOA
The task is to determine the length of the longest isolated proper substring within a given string. An isolated proper substring must satisfy the following conditions:
- The substring is not the entire given string
inputString. - No character within the substring appears anywhere outside the substring.
Given a string inputString of length n, determine the length of its longest isolated proper substring. If no such substring exists, return 0.
Function Description
Implement the function findLongestIsolatedSubstringLength in the editor.
The function takes the following parameter:
String inputString: the string to analyze
Returns
int: the length of the longest isolated proper substring
1Example 1
Input
s = "abcba"
Output
0
Explanation

A new test case added on 03-01-2025 for your testing convenience :)
The source said the expected output should be 3 -
"abcba output should be : 3 (the substring will be bcb). but expected output is 0."
2Example 2
Input
s = "amazonservices"
Output
11
Explanation

(Image updated on 2025-02-02)
The longest self-sufficient proper substring is "zonservices" which has a length of 11.
Constraints
Limits and guarantees your solution can rely on.
sconsists of lowercase letters.1 ≤ n ≤ 10^5