Java Interview Questions Leetcode Two