Java Basic Questions Leetcode Solutions Two