Pregunta de entrevista de Oracle

Question on puzzles, and programming was asked