Microsoft interview question

Two Leetcode easies and one Medium