Code when practicing on http://oj.leetcode.com