http://oj.leetcode.com/problems/candy/