Skip to content
CCC Python Course

Case analysis and edge cases

Stage
2
Module
M2.6
Lessons
1

In this module

  • Enumerate the edge cases a problem's own bounds allow, such as the smallest input, all-equal values, and ties.
  • Check each edge case against the statement's exact wording, not against what a typical input looks like.
  • Recognize when a case a bound allows is impossible to satisfy, and decide what your program should do there.

Before this module

Lessons

  1. 1Case analysis and edge cases

Practice

Try these on the judge. Each link opens the problem on WMOJ.

  1. 2024 J4
    Troublesome Keys (opens on WMOJ in a new tab) WMOJ

    Find which two keys on a keyboard are malfunctioning, from what was typed and what appeared.

  2. 2025 S1
    Positioning Peter's Paintings (opens on WMOJ in a new tab) WMOJ

    Find the smallest perimeter of a rectangular wall that holds two rectangular paintings.

  3. 2021 J1
    Boiling Water (opens on WMOJ in a new tab) WMOJ

    Decide whether a measured boiling point means an altitude above, at, or below sea level.