Bloomberg Interview Question

Very easy algorithm questions but will follow up.