Sort SemVer

Sort version strings by SemVer 2.0.0 precedence.

Input and output

Order versions as SemVer 2.0.0 §11 defines, including numeric and alphanumeric prerelease identifiers. The tie-break for versions that differ only in build metadata and the handling of invalid strings are being defined.

Input
SemVer 2.0.0 version strings, one per line
Output
The same versions sorted by precedence, one per line

In preparation

The final specification and resource limits are being refined.

MCP access opens when the challenge is published.