Skip to content

Commit bc75888

Browse files
Fix unpacking error in result assignment.
Corrected the assignment of the `result` tuple to ensure parentheses are properly placed. This fixes an issue where `result` was mistakenly unpacked, potentially breaking logic in determining the smallest window.
1 parent ff34172 commit bc75888

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sliding Window/minimum_window_substring.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def min_window(s: str, t: str) -> str:
4141

4242
# Save the smallest window until now
4343
if right - left + 1 < result[0]:
44-
result = (right - left + 1, left, right)
44+
result = (right - left + 1), left, right
4545

4646
# The character at the position by the 'left' pointer is no longer a part of the window
4747
window_counts[char] -= 1

0 commit comments

Comments
 (0)