Longest Substring Without Repeating Characters
原理: 历遍字符串,查看当前字符是否出现过,当出现过的时候,子串开始位置+1,否则更新locs数组中的地址值为当前位置。
public class Solution {
public int lengthOfLongestSubstring(String s) {
int[] locs = new int[256];
int index = 0;
原创
2015-07-05 22:54:10 ·
406 阅读 ·
0 评论