Hi, I need some help with the following problem:
I have a series of positive & negative numbers which looks like this:
1 2 3 -1 -3 4 4 6 -3 -7
I would like to keep the first positive number in a series of positive numbers & set all other positive numbers in that series to 0. At the same time, I would like to keep the last negative number in a series of negative numbers. So what I need in the end is:
1 0 0 0 -3 4 0 0 0 -7
It would be great if someone could help me! Thanks, Hannah
Best Answer