Brute Force
Try every candidate. Correct by construction, the baseline to beat.
Brute 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.
Cost
- Space
- O(1)