Why is the brute-force approach less ideal here?
Practice this question from Generate Parentheses - Valid State Backtracking Pattern Practice Quiz, with options and an explanation.
Question
Why is the brute-force approach less ideal here?
Option A — Correct answer
Generate-and-filter creates many invalid states.
Option B
It always avoids invalid states
Option C
It uses no recursion
Option D
It only works for sorted arrays
Explanation
Generate-and-filter creates many invalid states.