leetcode "Partition List " 1/27/2014

not figure it out myself, the solution is kind of smart