Why is the brute-force approach less ideal here?

Practice this question from Subarray Sum Equals K - Prefix Sum Hashmap Pattern Practice Quiz, with options and an explanation.

Question

Why is the brute-force approach less ideal here?

Option A — Correct answer

It checks every start and end index.

Option B

It is always constant time

Option C

It uses no repeated work

Option D

It requires binary tree recursion

Explanation

It checks every start and end index.

Subarray Sum Equals K - Prefix Sum Hashmap Pattern Practice Quiz

All questions · Previous question · Next question

Open on QuizMaker