I am looking for a compact and elegant way without using itertools.
The function takes a string that comprises of parenthesis (an open bracket is gua