leetcode (java) writen by myself