One more leetcode solution