my leetcode resolutions in Java