LeetCode quiz solutions in Java