java solution for leetcode-problems