Pergunta de entrevista da empresa Revolut

Was that the most efficient solution?