Pergunta de entrevista da empresa Bloomberg

I was asked to write a macro in c++