Question d’entretien chez Klarna

How would you solve problem X given the code.