sort
find mid point
take one from the end of the two lists one by one
class Solution(object):
def wiggleSort(self, nums):
"""
:type nums: List[int]
:rtype: void Do not return anything, modify nums in-place instead.
"""
temp=nums[:]
temp.sort()
small,large=(len(nums)-1)/2,len(nums)-1
for i in xrange(len(nums)):
if i%2==0:
nums[i]=temp[small]
small-=1
else:
nums[i]=temp[large]
large-=1
O(n)+O(1) after median --- Virtual Indexing
https://discuss.leetcode.com/topic/32929/o-n-o-1-after-median-virtual-indexing
read and come back to it