Separating out the negative numbers in an time o(n) and space o(n)