my Leetcode assignment