Rearrange an array such that it contains alternate positive and negative numbers
Given an integer array, rearrange it such that it contains positive and negative numbers at alternate positions. If the array contains more positive or negative elements, move them to the end of the array.