Microsoft Interview Question

Can find it on most recent microsoft questions on Leetcode