Solutions to some specific leetcode problems