-
Create a function called
merge_two_list
that expects an list of numbers (integers). -
Loop through the list and separate the
odd
and theeven
numbers in different lists. -
If the number is odd number push it to a placeholder list named
odd
. -
If the number is even number push it to a placeholder list named
even
. -
Then concatenate the
odd
list to the even list to combine them. Remember, theodd
list comes first and you have to append the evenmergeTwoList
.
- Create empty (placeholder) variables when you need to store data.
mergeTwoList([1,2,33,10,20,4])
[[1,33,2], [10,20,4]]