Microsoft Interview Question

2 mid-level coding problems, similar to Leetcode.