Why is the brute-force approach less ideal here?

Practice this question from Power of Two - n and n-1 Pattern Practice Quiz, with options and an explanation.

Question

Why is the brute-force approach less ideal here?

Option A — Correct answer

Repeated division is longer and easier to mishandle for edge cases.

Option B

It always uses less memory

Option C

It avoids all edge cases

Option D

It does not read the input

Explanation

Repeated division is longer and easier to mishandle for edge cases.

Power of Two - n and n-1 Pattern Practice Quiz

All questions · Previous question · Next question

Open on QuizMaker