Given a sequence of open or close parathesis signs, print maximum matches in the order they appear or delete unmatched parathesis signs.
e.g:
-
in: ((())()) out: ((())())
-
in: ((())() out: (())()
In the second example, you can interpretatee it as : ?(())() where '?' should be deleted