Bloomberg Interview Question

I'm not sure but i practiced leetcode questions.