IBM Interview Question

Generate Parentheses medium 3sum medium