Pregunta de entrevista de Anonymous

Programming problem solved at home and extensively discussed during technical interview.