Question d’entretien chez EY

Asked to code for the given scenario.