Bloomberg Interview Question

2 Leetcode medium difficulty within 1 hour