Pregunta de entrevista de DXC Technology

Solve the code as per the given inputs and outputs.