This is the leetcode writen by Java