Microsoft Interview Question

Leetcode easy coding problem