Code for LeetCode