Question d’entretien chez AppBeat

Write code for given problem.