Ibm Coding Questions Leetcode 1509