Microsoft interview question

3 Medium Problems from Leetcode