Bloomberg interview question

Leetcode problems from medium to hard