Given a string, find the length of the longest substring without repeating characters. Examples: Given "abcabcbb", the answer is "abc", which the length is 3. Given "bbbbb", the answer is "b", with the length of 1. Giv en "pwwkew", the answer is "wk
这道题使用双指针(滑动窗口)+哈希表可破。
public int lengthOfLongestSubstring(String s) {
if (s==null||s.equals(""))
return 0;
int start = 0;
int end = 0;
char[] arr = s.toCharArray();
int[] hash = new int[128]; //构建