Rearrange a given list such that all the odd numbers appear before all the even numbers. Besides for this requirement, the output list may be in any order.
The input will only contain integers, but they may be negative and there may be duplicates, and they may appear in any order.
Shortest solution wins.
Test cases
[1,2]
→ [1,2]
[2,1]
→ [1,2]
[1,0,0]
→ [1,0,0]
[0,0,-1]
→ [-1,0,0]
[3,4,3]
→ [3,3,4]
[-4,3,3]
→ [3,3,-4]
[2,2,2,3]
→ [3,2,2,2]
[3,2,2,2,1,2]
→ [1,3,2,2,2,2]
or [3,1,2,2,2,2]
[-2,-2,-2,-1,-2,-3]
→ [-1,-3,-2,-2,-2,-2,]
or [-3,-1,-2,-2,-2,-2,]
[]
→ []