We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2fc1dda commit 5a99c68Copy full SHA for 5a99c68
1 file changed
longest-substring-without-repeating-characters/gyeo-ri.py
@@ -10,9 +10,7 @@ def lengthOfLongestSubstring(self, s: str) -> int:
10
start_idx += 1
11
12
used_characters.add(s[end_idx])
13
- current_length = end_idx - start_idx + 1
14
- if current_length > longest_length:
15
- longest_length = current_length
+ longest_length = max(longest_length, end_idx - start_idx + 1)
16
17
return longest_length
18
0 commit comments