Microsoft Interview Question

One of the questions was leetcode easy.