This is my practice on leetcode using java.