IBM Interview Question

They gave a Leetcode Question