Amazon interview question

Generate parenthesis leetcode (medium difficulty)