FAILURE MAP
← Case archive

FA-96404 / Phone number formatting / Member archive

Variable-length area code grouping: the trunk zero is counted as a national digit · case 04

Every number typed with its leading 0 is rejected.

Member previewVariant 4 · 3 implementations · 8 checks per implementation

Case contract

Keep digits and drop one leading trunk 0; nine national digits must remain. Numbers starting 7 are mobile with a four-digit block code; otherwise the area code is the longest match from 2, 30, 31, 40, 4012 (no match -> None). The subscriber part is one group if at most 5 digits, two equal halves if even, else 3 then the rest. Return "0" + area + " " + groups joined by spaces.

Why this case matters

Area codes of different lengths share leading digits; choosing the wrong one regroups every digit and prints a number users cannot dial.

One recorded failure

Sample boundary fixture

This sample comes from the broken implementation of a controlled reproducer.

Boundary fixtureActualExpectedOutcome
one-digit areanull"02 5550 4567"Failed

MEMBER ARCHIVE

The complete case is available to members.

This record includes three runnable implementations, regression fixtures, execution results, and source hashes.

Member access is invitation-based. Sign in with your invited account to inspect the sources.

Sign in to the archive ↗