Pregunta de entrevista de Accenture

Aptitude question Two coding questions