Skip to content

Commit 778fc8c

Browse files
committed
Update: 0003-longest-substring-without-repeating-characters.js
1 parent 2b9810e commit 778fc8c

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

javascript/0003-longest-substring-without-repeating-characters.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,11 @@ var lengthOfLongestSubstring = function (s) {
1010
let l = 0;
1111
let max = 0;
1212

13-
for (let r = 0, sl = s.length; r < sl; r++) {
13+
for (let r = 0; r < s.length; r++) {
1414
while (set.has(s[r])) {
1515
set.delete(s[l]);
1616
l++;
1717
}
18-
1918
set.add(s[r]);
2019
max = Math.max(max, set.size);
2120
}

0 commit comments

Comments
 (0)