Realise LeetCode in Java