Microsoft Interview Question

Leetcode type easy middle hard