Citi Interview Question

given a case scenario and expected to code solution to it