### Problem
For balanced s, score "()" as 1, concatenation AB as score(A)+score(B), and nesting (A) as 2*score(A). Return the total score.
```cpp
class Solution {
public:
int scoreOfParentheses(string s);
};
```
### Examples
**Example 1:**
```text
s = "(()())"
Output: 4
Explanation: The inner concatenation scores2, then the outer pair doubles it.
```
**Example 2:**
```text
s = "()(())"
Output: 3
Explanation: The two concatenated pieces score1 and2.
```
### Constraints
- Input length lies in [2,50].
- Characters are parentheses only and the string is balanced.
### Contract considerations
Keep additive concatenation and multiplicative nesting distinct.
```hint Read the boundary condition
How many enclosing pairs double the contribution of one innermost ()?
```
### Boundary reminders
Keep additive concatenation and multiplicative nesting distinct.
Overview: Score a Balanced Parenthesis Expression. For balanced s, score "()" as 1, concatenation AB as score(A)+score(B), and nesting (A) as 2*score(A).