Skip to content

Commit 8ba36a1

Browse files
authored
Update longest_valid_paranthesis.py
added necessary changes!
1 parent f1cd3ec commit 8ba36a1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

strings/longest_valid_paranthesis.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,11 @@ def longest_valid_paranthesis(self, s: str) -> int:
2323
else:
2424
res = max(res, preceeding_matched)
2525
preceeding_matched = 0
26-
2726
res = max(res, preceeding_matched)
2827

2928
while stack:
3029
res = max(res, stack.pop())
31-
3230
return res * 2
31+
if __name__ == "__main__":
32+
from doctest import testmod
33+
testmod()

0 commit comments

Comments
 (0)