Solution codes for Leetcode