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.