Solving Maximum Nesting Depth of Two Valid Parentheses Strings in go. Please try yourself first to solve the problem and submit your implementation to LeetCode before looking into solution.

Problem Description

  • It is the empty string, or

  • depth("") = 0

Example 1:

Input: seq = "(()())"
Output: [0,1,1,1,1,0]

Example 2:

Input: seq = "()(())()"
Output: [0,0,0,1,1,0,1,1]

Constraints:

  • 1 <= seq.size <= 10000

See the full details of the problem Maximum Nesting Depth of Two Valid Parentheses Strings at LeetCode

Originally posted at: @github.com/halfrost/LeetCode-Go