numbers. Replace every even number with 0 and every odd number with 1. Then sort the resulting array in non-decreasing order and return it.
In other words, the answer starts with one zero for each even number, followed by one 1 for each odd number.numbers=[7, 12, 9, 30, 5] → [0, 0, 1, 1, 1]
The even numbers 12 and 30 become 0, the odd 7, 9 and 5 become 1. That gives [1, 0, 1, 0, 1], which sorts into [0, 0, 1, 1, 1].
numbers=[8, 2, 6] → [0, 0, 0]
Every number is even, so only zeros remain.
numbers=[7, 12, 9, 30, 5]
[0, 0, 1, 1, 1]
Run checks the first 3 tests in your browser. Submit checks all 94 tests on the server, hidden ones included.