fosskers's Blog

fosskers's Avatar Image
Haskell -> Rust -> Lisps
← All posts

Time for another programming puzzle!

Given the list (9 3 7 1 8 2 4 6 13 1 1 5), sort it by “evenness subsections”, such that runs of even or odd numbers are sorted internally. So we’d expect the result here to be:

(1 3 7 9 2 4 6 8 1 1 5 13)

Bonus points if you can do it in “one pass” for whatever that means in your language of choice.

To like or reply, open original post on Emacs.ch