IBM Interview Question

One leetcode easy during interview