Pergunta de entrevista da empresa IBM

Series questions are tough.