Question d’entretien chez NTT DATA

Given a Coding question and had to solve