Solve http://oj.leetcode.com/problems/reorder-list/