Bloomberg Interview Question

leetcode problem number two hundred and forty three