Brute Force
Try every candidate; correct by construction, the baseline to beat.
Decision · step 2 of 17Brute Force: Found near the end
The search space is every pair (i, j) with i before j. That is the whole cost of brute force: the size of the space, since each candidate is checked in constant time.
What you will see
Every candidate is checked in order; the counter is the whole search space.
Cost
| Space | O(1) |
|---|
How you work with it here
play it through, step one change at a time, compare two runs.
Screen readers: Each paradigm lesson is narrated as the characteristic loop it performs; the comparison view is available as a table.
Reduced motion: Side-by-side panes update in place.