Solutions for some problems at leetcode