Pregunta de entrevista de ChannelNet

How would you optimize this algorithm?