java codes for leetcode problems