Given a balanced parentheses string s, compute and return the total score of the string based on the following rules:
A single pair () has a score of
The concatenation of two balanced substrings AB has a score of the score of A plus the score of B.
A balanced substring enclosed in parentheses (A) has a score of A.
Constraints:
s.length
s consists of only '(' and ')'.
s is a balanced parentheses string.
Given a balanced parentheses string s, compute and return the total score of the string based on the following rules:
A single pair () has a score of
The concatenation of two balanced substrings AB has a score of the score of A plus the score of B.
A balanced substring enclosed in parentheses (A) has a score of A.
Constraints:
s.length
s consists of only '(' and ')'.
s is a balanced parentheses string.