Problem
You are given a list nums of even length with equal numbers of positive and negative integers (no zeros). Return a new list where signs alternate, starting with a positive, and where the positives keep their original relative order and so do the negatives (preserve the order).
Example 1
- Input
- nums = [3, 1, -2, -5, 2, -4]
- Output
- [3, -2, 1, -5, 2, -4]
Example 2
- Input
- nums = [-1, 1]
- Output
- [1, -1]
Constraints
2 <= nums.length <= 2 * 10^5nums.length is even.1 <= |nums[i]| <= 10^5nums has the same number of positive and negative integers.