Skip to main content

Practice · 1 of 3

Budget Check

CHALLENGE
Difficulty: advanced+25 XP

**Scenario.** A problem has n ≤ 300000 and a 1 s limit (~3·10^8 ops ceiling). You have a correct O(n log^2 n) idea (≈ 3.3·10^8, borderline) and no O(n log n) idea yet. Best move? **Which approach is the best fit? The program only needs to print the letter.** **A)** Keep hunting for O(n log n) before writing anything **B)** Code the O(n log^2 n) now; optimize later only if needed **C)** Code O(n^2); it is simpler and surely correct **D)** Give up the problem and move on

Back to lesson: Practice: Process Drills