Skip to content

Commit d1b4a61

Browse files
Refactor variable for clarity in result comparison.
Replaced direct tuple comparison with a clearer `window_length` variable. This improves readability and makes the check for infinite length more intuitive. No change in functionality was introduced.
1 parent bc75888 commit d1b4a61

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Sliding Window/minimum_window_substring.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ def min_window(s: str, t: str) -> str:
5252
# Move the left pointer forward
5353
left += 1
5454

55-
if result[0] == float('inf'):
55+
window_length = result[0]
56+
57+
if window_length == float('inf'):
5658
return ''
5759

5860
# Build the result

0 commit comments

Comments
 (0)