3.无重复字符的最长子串 修改
This commit is contained in:
parent
5c2f228b54
commit
32457451e2
|
@ -65,7 +65,7 @@ impl Solution {
|
|||
if k < o {
|
||||
k = o;
|
||||
} else {
|
||||
ret = std::cmp::max(ret, i as i32 - k);
|
||||
ret = ret.max(i as i32 - k);
|
||||
}
|
||||
map[s[i] as usize] = i as i32;
|
||||
}
|
||||
|
@ -80,9 +80,6 @@ mod test {
|
|||
|
||||
#[test]
|
||||
fn test_q0003() {
|
||||
let s = "tmmzuxt".to_string();
|
||||
let substring_len = Solution::length_of_longest_substring(s);
|
||||
//println!("{}", substring_len);
|
||||
assert_eq!(substring_len, 5);
|
||||
assert_eq!(Solution::length_of_longest_substring("tmmzuxt".to_string()), 5);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue