Solutions to leetcode problems