my code of leetcode problem