Solutions of the problem on leetcode