Compute the score of a balanced parentheses string using stack-based rules.
Constraints
Example
>>> score_of_parentheses("()")
1
>>> score_of_parentheses("(())")
2
>>> score_of_parentheses("()()")
2
>>> score_of_parentheses("(()(()))")
6
Recent Submissions
No submissions yet — hit Run Tests to try!
Hints