I want to remove all the "unpartnered" or unpaired parenthesises from a string.

```
exampleStr = back-pay) zyzhk1219(17) zyzhk1329 zyzhk1595(15) zyzhk1988 zyzhk2004 zyzhk2131) jswioj((testsjkldf

```

The expected "parenthesis balanced" string should be

```
back-pay zyzhk1219(17) zyzhk1329 zyzhk1595(15) zyzhk1988 zyzhk2004 zyzhk2131 jswiojtestsjkldf

```

I saw some ruby based solution on stackoverflow. But, couldn't find one I can use in java.