From bf017ed7ac58ea0e1a12b369f46ee7fedb0f7f13 Mon Sep 17 00:00:00 2001 From: Vinayak Jaiswal Date: Mon, 31 Oct 2022 22:46:20 +0530 Subject: [PATCH 1/2] adding 32-Longest-Valid-Parentheses.py --- python/32-Longest-Valid-Parentheses.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 python/32-Longest-Valid-Parentheses.py diff --git a/python/32-Longest-Valid-Parentheses.py b/python/32-Longest-Valid-Parentheses.py new file mode 100644 index 0000000..dfa0c0f --- /dev/null +++ b/python/32-Longest-Valid-Parentheses.py @@ -0,0 +1,15 @@ +class Solution: + def longestValidParentheses(self, A: str) -> int: + s=[-1] + m=0 + for i in range(len(A)): + if A[i]=='(': + s.append(i) + + else: + s.pop() + if not s: + s.append(i) + else: + m=max(m,i-s[-1]) + return m \ No newline at end of file From 5484c8d0ba45b52a961401df62ddd1be18036eb4 Mon Sep 17 00:00:00 2001 From: Vinayak Jaiswal Date: Mon, 31 Oct 2022 22:50:22 +0530 Subject: [PATCH 2/2] adding personal info --- PARTICIPANTS.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/PARTICIPANTS.md b/PARTICIPANTS.md index 5a2e2f4..a43dcf7 100644 --- a/PARTICIPANTS.md +++ b/PARTICIPANTS.md @@ -142,3 +142,15 @@ - šŸ”­ Connect with me: **[Piyushjar](https://github.com/piyushjar))** --- + +--- +### Connect with me: + + + +- šŸ‘Øā€šŸ’» My name is **Vinayak Jaiswal** +- 🌱 I’m a FullStack Developer. +- šŸ“« Reach me: **vinayakjaiswal48@gmail.com** +- šŸ”­ Connect with me: **[Vinayakjaiswal07](https://github.com/Vinayakjaiswal07)** + +---