My personal leetcode solution