Pergunta de entrevista da empresa Mathnasium

do you know how to do this? (math concepts)