jeff ordered several items from an online shop. After recieving the order he found that some were faulty. So he wants to seperatethe faulty items from the rest. You are given that prices of the item Jeff ordered, where a negative sign indicates a faulty item. Write a program to shift prices of all the faulty items to the left without changing the relatie order of the input.
INPUT- 11 -12 13 -14 15 16
OUTPUT- -12 -14 11 13 15 16
INPUT- 21 11 -3 -2 9
OUTPUT- -3 -2 21 11 9
Comments
Leave a comment