In this Kata, you will be given a mathematical string and your task will be to remove all braces as follows:
```Haskell
solve("x-(y+z)") = "x-y-z"
solve("x-(y-z)") = "x-y+z"
solve("u-(v-w-(x+y))-z") = "u-v+w+x+y-z"
solve("x-(-y-z)") = "x+y+z"
```
There are no spaces in the expression. Only two operators are given: `"+" or "-"`. 
More examples in test cases. 
Good luck!
def solve(p):
    return "{}{}".format("$", "".join([["+", "-"][((len([j for j in range(len(p[:i])) if p[j:j+2] == "-(" and not len([k for k in range(len(p[:i])) if (k > j) and (p[k] == ")") and (p[j:k].count(")") < p[j:k].count("("))])])) + int(p[i-1] == "-"))%2] + c for i, c in enumerate(p) if c not in ["(", ")", "+", "-"]])).replace("$+", "").replace("$", "")


def solve(p):
    return "{}{}".format("$", "".join([["+", "-"][((len([j for j in range(len(p[:i])) if p[j:j+2] == "-(" and not len([k for k in range(len(p[:i])) if (k > j) and (p[k] == ")") and (p[j:k].count(")") < p[j:k].count("("))])])) + int(p[i-1] == "-"))%2] + c for i, c in enumerate(p) if c not in ["(", ")", "+", "-"]])).replace("$+", "").replace("$", "")

