Citi interview question

given a case scenario and expected to code solution to it