Question d’entretien chez Oracle

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