给定一个字符串s,找出其中不含有重复字符的最长子串的长度
class Solution {
public int lengthOfLongestSubstring(String s) {
int max=0
HashMath<Character,Integer> map=new<>();
if(s.length()==0){return 0;}
for(int start=0,end=0;end<s.length();end++){
if(map.containsKey(s.charAt(end))){start=Max.max(start,map.get(s.charAt(end))+1);}
map.put(s.charAt(end),end);
max=Max.max(max,start-end+1);
}
}
return max;
}