Capital One interview question

Balance parenthesis and brackets