Code for solving LeetCode problems