Pregunta de entrevista de HCLTech

Coding question and ask to code on spot