LeetCode solutions using Java