IBM Interview Question

Just standard leetcode problems, easy difficulty.