implemented a recursive algorithm that prints all possible combinations of opening and closing parentheses