← 返回 bloomberg 的题目列表Nested Parentheses
类型:online_judge
Given a string containing only '(' and ')', determine its depth. The depth of the string is defined as the maximum number of nested parentheses. For instance, for the input '((()))', the depth is 3, and for input '()', the depth is 1. Make sure to consider different edge cases such as an empty string, no valid parentheses, etc. Write a function to return this depth.
Example
Input
((()))