Pregunta de entrevista de AI Financial Power Group

About previous school projects. Basic algorithm question