added the two code for leetcode