Oracle interview question

Algorithm to print all valid open and close parenthesis? (leetcode question)