题目:Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for "abcabcbb" is "abc", which the length is 3. For "bbbbb" the longest substring is "b", with the length of 1. 分析:从头开始记录每个字母出现次数,如果出现过则计算目前子串长度,并从此处开始新的子串检测。 参考链接:http://blog.csdn.net/ojshilu/article/details/12168533 代码: