LeetCode solutions [Java]