Leetcode solution