My code for LeetCode Online Judge