Given an array with positive and negative integers. Re-range it to interleaving with positive and negative integers.
Note
You are not necessary to keep the original order or positive integers or negative integers.
Example
Given [-1, -2, -3, 4, 5, 6], after re-range, it will be [-1, 5, -2, 4, -3, 6] or any other legal answer.
Challenge
Do it in-place and without extra memory.
看了网上的一些解法,是很巧妙,但是编程起来感觉没自己的这个更清晰些!分享下咯
class Solution {
/**
......
阅读全文