my solution to the leetcode'