Solutions to exercises on leetcode