IBM Interview Question

Leetcode Mediums and one Hard.