This is my leetcode answers in Java.