Capital One Interview Question

Balance parenthesis and brackets