Given a string, return the minimal number of parenthesis reversals needed to make balanced parenthesis. 
For example:
```Javascript
solve(")(") = 2 Because we need to reverse ")" to "(" and "(" to ")". These are 2 reversals. 
solve("(((())") = 1 We need to reverse just one "(" parenthesis to make it balanced.
solve("(((") = -1 Not possible to form balanced parenthesis. Return -1.
```
Parenthesis will be either `"("` or `")"`. 
More examples in the test cases. 
Good luck.
def solve(s):
    if len(s) % 2: return -1
    count, swap = 0, 0
    for i,c in enumerate(s):
        count += (c == '(') - (c == ')')
        if count < 0:
            swap += 1 ; count = 1
        elif count > len(s)-i: 
            swap += 1 ; count -= 2
    return swap
def solve(s):
    if len(s) % 2: return -1
    count, swap = 0, 0
    for i,c in enumerate(s):
        count += (c == '(') - (c == ')')
        if count < 0:
            swap += 1 ; count = 1
        elif count > len(s)-i: 
            swap += 1 ; count -= 2
    return swap