IBM Interview Question

Easy-Medium Leetcode, not too hard