Leetcode solutions in Java