Pregunta de entrevista de IBM

Two coding questions were asked