Plz correct this

Hey I don’t think you can solve it like this.
Here 4 methods are discussed regarding the same:https://leetcode.com/problems/longest-valid-parentheses/solution/