Skip to main content
๐Ÿ“œ WAYPOINT LESSON

The Adversarial Checklist

โญโญโญ advancedโณ 12 min read๐Ÿ“ Lesson 240 of 281

Five input shapes break most unproven solutions. Run the checklist on every solution you are proud of.

The Adversarial Checklist

Before trusting any solution, attack it with these five shapes:

  1. All ties. Every element equal; every weight identical; every deadline the same. Tie-break branches that never ran on random data run now.
  2. Asymmetry. A path graph; one huge element among tiny ones; an interval swallowing all others. Symmetric data flatters symmetric bugs.
  3. Degeneracy. n = 1; n = 0 if legal; empty ranges; single-point intervals; self-loops; duplicates everywhere.
  4. Extremes. Maximum values (overflow), minimum values (underflow of assumptions like "positive"), alternating max/min patterns that maximize comparison counts.
  5. Adversarial order. Sorted-descending input to a "sort then process" claim; reversed trees; queries ordered worst-case-first.

The mindset

For each shape, the question is not "will my code break?" but "what would I input if I were trying to break it?" That inversion finds bugs that rereading never will, because you wrote the code and your brain auto-corrects while reading.

Cost-benefit

The checklist costs minutes. A wrong submission costs the problem, the confidence, and often the contest. There is no scenario where skipping the checklist is correct arithmetic.