IBM Interview Question

Two leetcode questions in 45 minutes