class NoRepeatSubstring {
public static int findLength(String str) {
int start = 0, end = 0, longestSs = Integer.MIN_VALUE;
while(end < str.length()) {
String currentSs = str.substring(start,end);
longestSs = Math.max(longestSs,currentSs.length());
Character incoming = str.charAt(end);
while(currentSs.indexOf(incoming) != -1) currentSs = str.substring(++start,end);
end++;
}
return longestSs;
}
}