Bloomberg interview question

Leetcode approx. medium difficulty problems