Write a function named split_stack
that accepts as a parameter a list
of integers,
and re-orders it so that all the non-negative numbers are at the beginning in the reverse of their original relative order,
and all the negative numbers are at the end in the reverse of their original relative order.
For example, if passed the list [4, 0, -1, 5, -6, -3, 2, 7]
, your function should modify the list to store [-3, -6, -1, 7, 2, 5, 0, 4]
.
Constraints: Do not declare any auxiliary data structures (e.g. sets, dictionaries, etc.) other than a single
list
of integers.