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

1. First ignore some requirements and give a quick solution.
2. Put constraints back and polish the solution accordingly.
In the program, the quick solutions is 
candy[i] = 1 + (ratings[i]>ratings[i-1]?) candy[i] : 0
and the constraints are the lower-bounds for each candy[i].