http://leetcode.com/oldoj#question_30