Why is the brute-force approach less ideal here?
Practice this question from Modular Inverse - Extended Euclid Pattern Practice Quiz, with options and an explanation.
Question
Why is the brute-force approach less ideal here?
Option A — Correct answer
Trying every possible x costs O(m).
Option B
It always has better space complexity
Option C
It skips reading some inputs
Option D
It only works on strings
Explanation
Trying every possible x costs O(m).