Java Practice Coding Problems Leetcode 1501097530