Question d’entretien chez Bloomberg

how to solve the valid transaction algorithm problem