← Stack & Queue Quiz: all 8 questions
Stack & Queue Quiz · Question 2 of 8
Which strings are valid bracket sequences? (select all that apply)
Which strings are valid bracket sequences? (select all that apply)
- A.()[]{}
- B.{[()]}
- C.([)]
- D.((
Answer & explanation
Correct answer: ()[]{} · {[()]}
"([)]" closes ( before ], breaking the most-recent-first rule; "((" never closes.
Can you get the rest right without peeking?
Take the timed Stack & Queue Quiz quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →