Why is the brute-force approach less ideal here?
Practice this question from Longest Common Prefix - Single Branch Trie Pattern Practice Quiz, with options and an explanation.
Question
Why is the brute-force approach less ideal here?
Option A — Correct answer
Checking every prefix length repeats comparisons.
Option B
It always uses no memory
Option C
It avoids all state changes
Option D
It only works for binary search
Explanation
Checking every prefix length repeats comparisons.