출처 : https://leetcode.com/problems/longest-substring-without-repeating-characters/
Given a string s, find the length of the longest substring without repeating characters.

class Solution {
public int lengthOfLongestSubstring(String s) {
String substring = "";
int max = 0;
int count = 0;
ArrayList<Character> arrayList = new ArrayList<>();
while (count < s.length()) {
for (int i = count; i < s.length(); i++) {
if (arrayList.contains(s.charAt(i))) {
if (substring.length() > max) {
max = substring.length();
}
arrayList.clear();
count++;
substring = "";
break;
} else {
arrayList.add(s.charAt(i));
substring += s.charAt(i);
}
}
}
return max;
}
}